mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-09-10 05:52:21 +08:00
Remove relocation against discarded sections for relocatable link.
bfd/ 2010-04-30 H.J. Lu <hongjiu.lu@intel.com> PR ld/11542 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): New. * elf32-i386.c (elf_i386_relocate_section): Use it. * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. ld/testsuite/ 2010-04-30 H.J. Lu <hongjiu.lu@intel.com> PR ld/11542 * ld-elf/discard.ld: New. * ld-elf/discard1.d: Likewise. * ld-elf/discard1.s: Likewise. * ld-elf/discard2.d: Likewise. * ld-elf/discard2.s: Likewise. * ld-elf/discard3.d: Likewise.
This commit is contained in:
@ -1,3 +1,13 @@
|
||||
2010-04-30 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR ld/11542
|
||||
* ld-elf/discard.ld: New.
|
||||
* ld-elf/discard1.d: Likewise.
|
||||
* ld-elf/discard1.s: Likewise.
|
||||
* ld-elf/discard2.d: Likewise.
|
||||
* ld-elf/discard2.s: Likewise.
|
||||
* ld-elf/discard3.d: Likewise.
|
||||
|
||||
2010-04-22 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* ld-elf/extract-symbol-1sec.d: Update lma.
|
||||
|
3
ld/testsuite/ld-elf/discard.ld
Normal file
3
ld/testsuite/ld-elf/discard.ld
Normal file
@ -0,0 +1,3 @@
|
||||
SECTIONS {
|
||||
/DISCARD/ : { *(.discard) }
|
||||
}
|
9
ld/testsuite/ld-elf/discard1.d
Normal file
9
ld/testsuite/ld-elf/discard1.d
Normal file
@ -0,0 +1,9 @@
|
||||
#source: discard1.s
|
||||
#ld: -r -T discard.ld
|
||||
#readelf: -r
|
||||
#target: x86_64-*-linux-gnu i?86-*-linux-gnu
|
||||
|
||||
Relocation section '.rel.*.debug_info' at offset 0x[0-9a-z]+ contains 1 entries:
|
||||
[ \t]+Offset[ \t]+Info[ \t]+Type[ \t]+Sym.*
|
||||
[0-9a-f]+[ \t]+[0-9a-f]+[ \t]+R_.*[ \t]+[0-9a-f]+[ \t]+bar.*
|
||||
#pass
|
11
ld/testsuite/ld-elf/discard1.s
Normal file
11
ld/testsuite/ld-elf/discard1.s
Normal file
@ -0,0 +1,11 @@
|
||||
.globl bar
|
||||
.data
|
||||
bar:
|
||||
.long 1
|
||||
.section .discard,"aw",%progbits
|
||||
.align 4
|
||||
there:
|
||||
.long 2
|
||||
.section .debug_info,"",%progbits
|
||||
.long bar
|
||||
.long there
|
9
ld/testsuite/ld-elf/discard2.d
Normal file
9
ld/testsuite/ld-elf/discard2.d
Normal file
@ -0,0 +1,9 @@
|
||||
#source: discard2.s
|
||||
#ld: -r -T discard.ld
|
||||
#readelf: -r
|
||||
#target: x86_64-*-linux-gnu i?86-*-linux-gnu
|
||||
|
||||
Relocation section '.rel.*.debug_info' at offset 0x[0-9a-z]+ contains 1 entries:
|
||||
[ \t]+Offset[ \t]+Info[ \t]+Type[ \t]+Sym.*
|
||||
[0-9a-f]+[ \t]+[0-9a-f]+[ \t]+R_.*[ \t]+[0-9a-f]+[ \t]+here.*
|
||||
#pass
|
12
ld/testsuite/ld-elf/discard2.s
Normal file
12
ld/testsuite/ld-elf/discard2.s
Normal file
@ -0,0 +1,12 @@
|
||||
.globl here
|
||||
.data
|
||||
here:
|
||||
.long 1
|
||||
.globl there
|
||||
.section .discard,"aw",%progbits
|
||||
.align 4
|
||||
there:
|
||||
.long 2
|
||||
.section .debug_info,"",%progbits
|
||||
.long here
|
||||
.long there
|
11
ld/testsuite/ld-elf/discard3.d
Normal file
11
ld/testsuite/ld-elf/discard3.d
Normal file
@ -0,0 +1,11 @@
|
||||
#source: discard1.s
|
||||
#source: discard2.s
|
||||
#ld: -r -T discard.ld
|
||||
#readelf: -r
|
||||
#target: x86_64-*-linux-gnu i?86-*-linux-gnu
|
||||
|
||||
Relocation section '.rel.*.debug_info' at offset 0x[0-9a-z]+ contains 2 entries:
|
||||
[ \t]+Offset[ \t]+Info[ \t]+Type[ \t]+Sym.*
|
||||
[0-9a-f]+[ \t]+[0-9a-f]+[ \t]+R_.*[ \t]+[0-9a-f]+[ \t]+bar.*
|
||||
[0-9a-f]+[ \t]+[0-9a-f]+[ \t]+R_.*[ \t]+[0-9a-f]+[ \t]+here.*
|
||||
#pass
|
Reference in New Issue
Block a user