mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-11-28 22:21:49 +01:00
microblaze: drop remnants of manual reloc
Runtime relocation has been made the default for microblaze, so do the following cleanups: - drop all manual reloc codepaths in start.S - drop all STATIC_RELA ifdefs, as it is now enabled unconditionally in Kconfig Reviewed-by: Michal Simek <michal.simek@amd.com> Signed-off-by: Ovidiu Panait <ovpanait@gmail.com> Link: https://lore.kernel.org/r/20230311173838.521804-5-ovpanait@gmail.com Signed-off-by: Michal Simek <michal.simek@amd.com>
This commit is contained in:
parent
3363cf96eb
commit
7ac50f88f8
@ -13,10 +13,6 @@ LDFLAGS_FINAL += --gc-sections
|
|||||||
|
|
||||||
ifeq ($(CONFIG_SPL_BUILD),)
|
ifeq ($(CONFIG_SPL_BUILD),)
|
||||||
PLATFORM_CPPFLAGS += -fPIC
|
PLATFORM_CPPFLAGS += -fPIC
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_STATIC_RELA),y)
|
|
||||||
PLATFORM_CPPFLAGS += -fPIC
|
|
||||||
LDFLAGS_u-boot += -pic
|
LDFLAGS_u-boot += -pic
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
extra-y = start.o
|
extra-y = start.o
|
||||||
obj-y = irq.o
|
obj-y = irq.o
|
||||||
obj-y += interrupts.o cache.o exception.o cpuinfo.o
|
obj-y += interrupts.o cache.o exception.o cpuinfo.o relocate.o
|
||||||
obj-$(CONFIG_STATIC_RELA) += relocate.o
|
|
||||||
obj-$(CONFIG_XILINX_MICROBLAZE0_PVR) += pvr.o
|
obj-$(CONFIG_XILINX_MICROBLAZE0_PVR) += pvr.o
|
||||||
obj-$(CONFIG_SPL_BUILD) += spl.o
|
obj-$(CONFIG_SPL_BUILD) += spl.o
|
||||||
|
|||||||
@ -10,16 +10,11 @@
|
|||||||
#include <asm-offsets.h>
|
#include <asm-offsets.h>
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
#if defined(CONFIG_STATIC_RELA)
|
|
||||||
#define SYM_ADDR(reg, reg_add, symbol) \
|
#define SYM_ADDR(reg, reg_add, symbol) \
|
||||||
mfs r20, rpc; \
|
mfs r20, rpc; \
|
||||||
addik r20, r20, _GLOBAL_OFFSET_TABLE_ + 8; \
|
addik r20, r20, _GLOBAL_OFFSET_TABLE_ + 8; \
|
||||||
lwi reg, r20, symbol@GOT; \
|
lwi reg, r20, symbol@GOT; \
|
||||||
addk reg, reg reg_add;
|
addk reg, reg reg_add;
|
||||||
#else
|
|
||||||
#define SYM_ADDR(reg, reg_add, symbol) \
|
|
||||||
addi reg, reg_add, symbol
|
|
||||||
#endif
|
|
||||||
|
|
||||||
.text
|
.text
|
||||||
.global _start
|
.global _start
|
||||||
@ -35,7 +30,6 @@ _start:
|
|||||||
addi r1, r0, CONFIG_SPL_STACK
|
addi r1, r0, CONFIG_SPL_STACK
|
||||||
#else
|
#else
|
||||||
add r1, r0, r20
|
add r1, r0, r20
|
||||||
#if defined(CONFIG_STATIC_RELA)
|
|
||||||
bri 1f
|
bri 1f
|
||||||
|
|
||||||
/* Force alignment for easier ASM code below */
|
/* Force alignment for easier ASM code below */
|
||||||
@ -67,7 +61,6 @@ uboot_sym_start:
|
|||||||
|
|
||||||
brlid r15, mb_fix_rela
|
brlid r15, mb_fix_rela
|
||||||
nop
|
nop
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
addi r1, r1, -4 /* Decrement SP to top of memory */
|
addi r1, r1, -4 /* Decrement SP to top of memory */
|
||||||
@ -310,7 +303,6 @@ relocate_code:
|
|||||||
brlid r15, __setup_exceptions
|
brlid r15, __setup_exceptions
|
||||||
nop
|
nop
|
||||||
|
|
||||||
#if defined(CONFIG_STATIC_RELA)
|
|
||||||
/* reloc_offset is current location */
|
/* reloc_offset is current location */
|
||||||
SYM_ADDR(r10, r0, _start)
|
SYM_ADDR(r10, r0, _start)
|
||||||
|
|
||||||
@ -331,27 +323,7 @@ relocate_code:
|
|||||||
add r9, r9, r5
|
add r9, r9, r5
|
||||||
brlid r15, mb_fix_rela
|
brlid r15, mb_fix_rela
|
||||||
nop
|
nop
|
||||||
|
|
||||||
/* end of code which does relocation */
|
/* end of code which does relocation */
|
||||||
#else
|
|
||||||
/* Check if GOT exist */
|
|
||||||
addik r21, r23, _got_start
|
|
||||||
addik r22, r23, _got_end
|
|
||||||
cmpu r12, r21, r22
|
|
||||||
beqi r12, 2f /* No GOT table - jump over */
|
|
||||||
|
|
||||||
/* Skip last 3 entries plus 1 because of loop boundary below */
|
|
||||||
addik r22, r22, -0x10
|
|
||||||
|
|
||||||
/* Relocate the GOT. */
|
|
||||||
3: lw r12, r21, r0 /* Load entry */
|
|
||||||
addk r12, r12, r23 /* Add reloc offset */
|
|
||||||
sw r12, r21, r0 /* Save entry back */
|
|
||||||
|
|
||||||
cmpu r12, r21, r22 /* Check if this cross boundary */
|
|
||||||
bneid r12, 3b
|
|
||||||
addik r21. r21, 4
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Flush caches to ensure consistency */
|
/* Flush caches to ensure consistency */
|
||||||
brlid r15, flush_cache_all
|
brlid r15, flush_cache_all
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user