Skip to content
Snippets Groups Projects
Commit 0ba8926e authored by Gabor Juhos's avatar Gabor Juhos Committed by Daniel Schwierzeck
Browse files

MIPS: u-boot.lds: add relocation specific sections


This section contain the table needed for dynamic
relocation. Also provide symbols for the relocation
code to access the table.

Discard all sections which are not needed in the final
ELF binary and U-Boot image. Section .dynsym cannot be
discarded or GNU ld crashes otherwise. This section
will be stripped by GNU objcpy in a later patch.

Signed-off-by: default avatarGabor Juhos <juhosg@openwrt.org>
Signed-off-by: default avatarDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
parent 28875e2c
No related branches found
No related tags found
No related merge requests found
...@@ -70,7 +70,35 @@ SECTIONS ...@@ -70,7 +70,35 @@ SECTIONS
. = ALIGN(4); . = ALIGN(4);
__image_copy_end = .; __image_copy_end = .;
.bss : { .rel.dyn : {
__rel_dyn_start = .;
*(.rel.dyn)
__rel_dyn_end = .;
}
.deadcode : {
/*
* Workaround for a binutils feature (or bug?).
*
* The GNU ld from binutils puts the dynamic relocation
* entries into the .rel.dyn section. Sometimes it
* allocates more dynamic relocation entries than it needs
* and the unused slots are set to R_MIPS_NONE entries.
*
* However the size of the .rel.dyn section in the ELF
* section header does not cover the unused entries, so
* objcopy removes those during stripping.
*
* Create a small section here to avoid that.
*/
LONG(0xffffffff);
}
.dynsym : {
*(.dynsym)
}
.bss __rel_dyn_start (OVERLAY) : {
__bss_start = .; __bss_start = .;
*(.sbss.*) *(.sbss.*)
*(.bss.*) *(.bss.*)
...@@ -78,4 +106,16 @@ SECTIONS ...@@ -78,4 +106,16 @@ SECTIONS
. = ALIGN(4); . = ALIGN(4);
__bss_end = .; __bss_end = .;
} }
/DISCARD/ : {
*(.dynbss)
*(.dynstr)
*(.dynamic)
*(.interp)
*(.hash)
*(.gnu.*)
*(.plt)
*(.got.plt)
*(.rel.plt)
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment