Browse Source
Symbol symbol defined by an assignment in a linker script has type bfd_link_hash_new. elf_i386_convert_load and elf_x86_64_convert_load should check bfd_link_hash_new to see if a symbol is defined by a linker script. bfd/ PR ld/19175 * elf32-i386.c (elf_i386_convert_load): Check bfd_link_hash_new instead of calling bfd_link_get_defined_symbol. * elf64-x86-64.c (elf_x86_64_convert_load): Likewise. Skip relocation overflow for bfd_link_hash_new. * linker.c (bfd_link_get_defined_symbol): Removed. * bfd-in2.h: Regenerated. ld/testsuite/ PR ld/19175 * ld-i386/i386.exp: Run pr19175. * ld-x86-64/x86-64.exp: Likewise. * ld-i386/pr19175.d: New file. * ld-i386/pr19175.s: Likewise. * ld-i386/pr19175.t: Likewise. * ld-x86-64/pr19175.d: Likewise. * ld-x86-64/pr19175.s: Likewise. * ld-x86-64/pr19175.t: Likewise.users/ARM/embedded-binutils-2_26-branch
14 changed files with 102 additions and 102 deletions
@ -0,0 +1,13 @@ |
|||||
|
#source: pr19175.s |
||||
|
#as: --32 |
||||
|
#ld: -Bsymbolic -shared -melf_i386 -T pr19175.t |
||||
|
#objdump: -dw |
||||
|
|
||||
|
.*: +file format .* |
||||
|
|
||||
|
|
||||
|
Disassembly of section .text: |
||||
|
|
||||
|
#... |
||||
|
[ ]*[a-f0-9]+: 8d 81 ([0-9a-f]{2} ){4} * lea -0x[a-f0-9]+\(%ecx\),%eax |
||||
|
#pass |
||||
@ -0,0 +1,5 @@ |
|||||
|
.globl _start |
||||
|
.type _start, @function |
||||
|
_start: |
||||
|
movl _text@GOT(%ecx), %eax |
||||
|
.size _start, .-_start |
||||
@ -0,0 +1,11 @@ |
|||||
|
EXTERN(_start) |
||||
|
ENTRY(_start) |
||||
|
|
||||
|
SECTIONS |
||||
|
{ |
||||
|
.text : |
||||
|
{ |
||||
|
_text = .; |
||||
|
*(.text*) |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
#source: pr19175.s |
||||
|
#as: --64 |
||||
|
#ld: -Bsymbolic -shared -melf_x86_64 -T pr19175.t |
||||
|
#objdump: -dw |
||||
|
|
||||
|
.*: +file format .* |
||||
|
|
||||
|
|
||||
|
Disassembly of section .text: |
||||
|
|
||||
|
#... |
||||
|
[ ]*[a-f0-9]+: 48 8d 05 ([0-9a-f]{2} ){4} * lea -0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <_start> |
||||
|
#pass |
||||
@ -0,0 +1,5 @@ |
|||||
|
.globl _start |
||||
|
.type _start, @function |
||||
|
_start: |
||||
|
movq _text@GOTPCREL(%rip), %rax |
||||
|
.size _start, .-_start |
||||
@ -0,0 +1,11 @@ |
|||||
|
EXTERN(_start) |
||||
|
ENTRY(_start) |
||||
|
|
||||
|
SECTIONS |
||||
|
{ |
||||
|
.text : |
||||
|
{ |
||||
|
_text = .; |
||||
|
*(.text*) |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue