From 9ef5d938819dff73d7640a2654b07df64670d7f9 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 19 Dec 2013 11:34:47 -0800 Subject: Set SHF_INFO_LINK bit for SHT_REL/SHT_RELA sections It is a good pratice to set the SHF_INFO_LINK bit when the sh_info field represents a section header index. bfd/ PR binutils/16317 * elf.c (assign_section_numbers): Set the SHF_INFO_LINK bit for SHT_REL/SHT_RELA sections when setting the sh_info field. binutils/testsuite/ PR binutils/16317 * binutils-all/readelf.s: Updated. * binutils-all/readelf.s-64: Likewise. ld/testsuite/ PR binutils/16317 * ld-elf/linkinfo1.s: New file. * ld-elf/linkinfo1a.d: Likewise. * ld-elf/linkinfo1b.d: Likewise. --- binutils/testsuite/ChangeLog | 6 ++++++ binutils/testsuite/binutils-all/readelf.s | 2 +- binutils/testsuite/binutils-all/readelf.s-64 | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'binutils') diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog index 1023526..a1e6724 100644 --- a/binutils/testsuite/ChangeLog +++ b/binutils/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2013-12-19 H.J. Lu + + PR binutils/16317 + * binutils-all/readelf.s: Updated. + * binutils-all/readelf.s-64: Likewise. + 2013-12-13 Kuan-Lin Chen Wei-Cheng Wang diff --git a/binutils/testsuite/binutils-all/readelf.s b/binutils/testsuite/binutils-all/readelf.s index 22fb5d1..303e0c7 100644 --- a/binutils/testsuite/binutils-all/readelf.s +++ b/binutils/testsuite/binutils-all/readelf.s @@ -6,7 +6,7 @@ Section Headers: # On the normal MIPS systems, sections must be aligned to 16 byte # boundaries. On IA64, text sections are aligned to 16 byte boundaries. +\[ 1\] .text +PROGBITS +00000000 0000(34|40) 0000(08|10) 00 +AX +0 +0 +(.|..) - +\[ 2\] .rel.+text +REL. +0+ 0+.* 0000.. 0. +. +1 +4 + +\[ 2\] .rel.+text +REL. +0+ 0+.* 0000.. 0. +I +. +1 +4 # MIPS targets put .rela.text here. #... +\[ .\] .data +PROGBITS +00000000 0000(3c|48|50) 0000(04|10) 00 +WA +0 +0 +(.|..) diff --git a/binutils/testsuite/binutils-all/readelf.s-64 b/binutils/testsuite/binutils-all/readelf.s-64 index ec31f3f..2e05d68 100644 --- a/binutils/testsuite/binutils-all/readelf.s-64 +++ b/binutils/testsuite/binutils-all/readelf.s-64 @@ -8,7 +8,7 @@ Section Headers: +\[ 1\] .text +PROGBITS +0000000000000000 +00000040 +00000000000000.. +0000000000000000 +AX +0 +0 +.* +\[ 2\] .rel.+text +REL. +0+ +0+.* - +000000000000001. +000000000000001. +. +1 +8 + +000000000000001. +000000000000001. +I +. +1 +8 +\[ 3\] .data +PROGBITS +0000000000000000 +000000(48|50) +000000000000000[48] +0000000000000000 +WA +0 +0 +.* +\[ 4\] .bss +NOBITS +0000000000000000 +000000(4c|50|54|58) -- cgit v1.1