Browse Source
Since __start_XXX and __stop_XXX symbols aren't defined when address load is being converted, we need to check if there is an XXX output section to get their section and value. This patch adds a new function, bfd_link_get_defined_symbol, to search for the XXX output section to check if __start_XXX and __stop_XXX symbols are defined. bfd/ PR ld/19171 * elf32-i386.c (elf_i386_convert_load): Call bfd_link_get_defined_symbol to check if a symbol is defined. * elf64-x86-64.c (elf_x86_64_convert_load): Call bfd_link_get_defined_symbol to get defined symbol section and value. * linker.c (bfd_link_get_defined_symbol): New function. * bfd-in2.h: Regenerated. ld/testsuite/ PR ld/19171 * ld-i386/lea1.s: Add tests for address load of __start_XXX and __stop_XXX. * ld-i386/mov1.s: Likewise. * ld-x86-64/lea1.s: Likewise. * ld-x86-64/mov1.s: Likewise. * ld-i386/lea1a.d: Updated. * ld-i386/lea1b.d: Likewise. * ld-i386/lea1c.d: Likewise. * ld-i386/mov1a.d: Likewise. * ld-i386/mov1b.d: Likewise. * ld-x86-64/lea1a.d: Likewise. * ld-x86-64/lea1b.d: Likewise. * ld-x86-64/lea1c.d: Likewise. * ld-x86-64/lea1d.d: Likewise. * ld-x86-64/lea1e.d: Likewise. * ld-x86-64/lea1f.d: Likewise. * ld-x86-64/mov1a.d: Likewise. * ld-x86-64/mov1b.d: Likewise. * ld-x86-64/mov1c.d: Likewise. * ld-x86-64/mov1d.d: Likewise.users/ARM/embedded-binutils-2_26-branch
25 changed files with 184 additions and 10 deletions
@ -1,6 +1,10 @@ |
|||
.text |
|||
.weak __start_my_section |
|||
.weak __stop_my_section |
|||
.globl _start |
|||
.type _start, @function |
|||
_start: |
|||
movl _DYNAMIC@GOT(%ecx), %eax |
|||
movl __start_my_section@GOT(%ecx), %eax |
|||
movl __stop_my_section@GOT(%ecx), %eax |
|||
.size _start, .-_start |
|||
|
|||
@ -1,6 +1,10 @@ |
|||
.text |
|||
.weak __start_my_section |
|||
.weak __stop_my_section |
|||
.globl _start |
|||
.type _start, @function |
|||
_start: |
|||
movq _DYNAMIC@GOTPCREL(%rip), %rax |
|||
movq __start_my_section@GOTPCREL(%rip), %rax |
|||
movq __stop_my_section@GOTPCREL(%rip), %rax |
|||
.size _start, .-_start |
|||
|
|||
Loading…
Reference in new issue