Commit 76a55989 authored by Vladimir Zapolskiy's avatar Vladimir Zapolskiy Committed by Tom Rini

sh: generate position independent code for all platforms

Finally add fpic compilation option to produce relocatable code.
Note that this requires to define CONFIG_NEEDS_MANUAL_RELOC for all
board files, also relocation support still has some limitations
(e.g. a developer should care not to overwrite the executing code or
memset() with zeroes not yet relocated data on malloc init etc.),
which may be fixed while switching to PIE.

Due to short investigation the architecture code is not ready for PIE
linking, this will require some manipulations with .dyn* sections.
Signed-off-by: default avatarVladimir Zapolskiy <>
parent 3500581e
......@@ -15,5 +15,6 @@ CONFIG_STANDALONE_LOAD_ADDR += -EB
LDFLAGS_FINAL = --gc-sections
PLATFORM_RELFLAGS += -ffixed-r13
......@@ -60,7 +60,7 @@ SECTIONS
PROVIDE (_fgot = .);
.got :
*(.got.plt) *(.got)
. = ALIGN(4);
} >ram
PROVIDE (_egot = .);
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment