stand: Move sections around to fix stand/ build with ld.lld on armv7
When building loader bits, lld fails with the following error: "ld: error: section: .dynamic is not contiguous with other relro sections" on both ubldr and EFI loader. Move .dynamic up to make ld.lld happy, adjust .got as necessary for ubldr. Tested on: OrangePi One (ld.lld, ubldr) Tested on: Banana Pi-M3 (ld.lld, ubldr) Tested on: qemu-armv7 (ld.lld, EFI) Tested on: qemu-armv7 (ld.bfd, EFI) Tested on: Raspberry Pi 2 (ld.bfd, ubldr) [manu] Tested on: Banana Pi-M2 (ld.bfd, ubldr) [manu] Reviewed by: andrew, emaste, imp Differential Revision: https://reviews.freebsd.org/D13942
This commit is contained in:
parent
4e617d8cb9
commit
62821e5720
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=328156
@ -32,6 +32,11 @@ SECTIONS
|
|||||||
.rela.got : { *(.rela.got) }
|
.rela.got : { *(.rela.got) }
|
||||||
.rela.got1 : { *(.rela.got1) }
|
.rela.got1 : { *(.rela.got1) }
|
||||||
.rela.got2 : { *(.rela.got2) }
|
.rela.got2 : { *(.rela.got2) }
|
||||||
|
.dynamic : { *(.dynamic) }
|
||||||
|
PROVIDE (_GOT_START_ = .);
|
||||||
|
.got : { *(.got) }
|
||||||
|
.got.plt : { *(.got.plt) }
|
||||||
|
PROVIDE (_GOT_END_ = .);
|
||||||
.rela.ctors : { *(.rela.ctors) }
|
.rela.ctors : { *(.rela.ctors) }
|
||||||
.rela.dtors : { *(.rela.dtors) }
|
.rela.dtors : { *(.rela.dtors) }
|
||||||
.rela.init : { *(.rela.init) }
|
.rela.init : { *(.rela.init) }
|
||||||
@ -58,7 +63,6 @@ SECTIONS
|
|||||||
}
|
}
|
||||||
.data1 : { *(.data1) }
|
.data1 : { *(.data1) }
|
||||||
.got1 : { *(.got1) }
|
.got1 : { *(.got1) }
|
||||||
.dynamic : { *(.dynamic) }
|
|
||||||
/* Put .ctors and .dtors next to the .got2 section, so that the pointers
|
/* Put .ctors and .dtors next to the .got2 section, so that the pointers
|
||||||
get relocated with -mrelocatable. Also put in the .fixup pointers.
|
get relocated with -mrelocatable. Also put in the .fixup pointers.
|
||||||
The current compiler no longer needs this, but keep it around for 2.7.2 */
|
The current compiler no longer needs this, but keep it around for 2.7.2 */
|
||||||
@ -74,10 +78,6 @@ SECTIONS
|
|||||||
.fixup : { *(.fixup) }
|
.fixup : { *(.fixup) }
|
||||||
PROVIDE (_FIXUP_END_ = .);
|
PROVIDE (_FIXUP_END_ = .);
|
||||||
PROVIDE (_GOT2_END_ = .);
|
PROVIDE (_GOT2_END_ = .);
|
||||||
PROVIDE (_GOT_START_ = .);
|
|
||||||
.got : { *(.got) }
|
|
||||||
.got.plt : { *(.got.plt) }
|
|
||||||
PROVIDE (_GOT_END_ = .);
|
|
||||||
/* We want the small data sections together, so single-instruction offsets
|
/* We want the small data sections together, so single-instruction offsets
|
||||||
can access them all, and initialized data all before uninitialized, so
|
can access them all, and initialized data all before uninitialized, so
|
||||||
we can shorten the on-disk segment size. */
|
we can shorten the on-disk segment size. */
|
||||||
|
@ -35,6 +35,7 @@ SECTIONS
|
|||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
PROVIDE (__bss_end = .);
|
PROVIDE (__bss_end = .);
|
||||||
}
|
}
|
||||||
|
.dynamic : { *(.dynamic) }
|
||||||
/* We want the small data sections together, so single-instruction offsets
|
/* We want the small data sections together, so single-instruction offsets
|
||||||
can access them all, and initialized data all before uninitialized, so
|
can access them all, and initialized data all before uninitialized, so
|
||||||
we can shorten the on-disk segment size. */
|
we can shorten the on-disk segment size. */
|
||||||
@ -54,7 +55,6 @@ SECTIONS
|
|||||||
}
|
}
|
||||||
__gp = .;
|
__gp = .;
|
||||||
.plt : { *(.plt) }
|
.plt : { *(.plt) }
|
||||||
.dynamic : { *(.dynamic) }
|
|
||||||
.reloc : { *(.reloc) }
|
.reloc : { *(.reloc) }
|
||||||
.dynsym : { *(.dynsym) }
|
.dynsym : { *(.dynsym) }
|
||||||
.dynstr : { *(.dynstr) }
|
.dynstr : { *(.dynstr) }
|
||||||
|
Loading…
Reference in New Issue
Block a user