elf: Set p_memsz to p_filesz for loadable PT_NOTE segment

Message ID 20210408140535.2004426-1-hjl.tools@gmail.com
State New
Headers show
Series
  • elf: Set p_memsz to p_filesz for loadable PT_NOTE segment
Related show

Commit Message

H.J. Lu via Binutils April 8, 2021, 2:05 p.m.
Since p_memsz of the loadable PT_NOTE segment should be the same as
p_filesz, set p_memsz on the loadable PT_NOTE segment when updating
p_filesz.

bfd/

	PR binutils/27708
	* elf.c (assign_file_positions_for_non_load_sections): Set
	p_memsz to p_filesz for the loadable PT_NOTE segment.

binutils/

	PR binutils/27708
	* testsuite/binutils-all/x86-64/pr27708.dump: New file.
	* testsuite/binutils-all/x86-64/pr27708.exe.bz2: Likewise.
	* testsuite/binutils-all/x86-64/x86-64.exp: Run binutils/27708
	test.
---
 bfd/elf.c                                     |   5 +++
 .../binutils-all/x86-64/pr27708.dump          |  33 +++++++++++++++
 .../binutils-all/x86-64/pr27708.exe.bz2       | Bin 0 -> 5815 bytes
 .../testsuite/binutils-all/x86-64/x86-64.exp  |  38 ++++++++++++++++++
 4 files changed, 76 insertions(+)
 create mode 100644 binutils/testsuite/binutils-all/x86-64/pr27708.dump
 create mode 100644 binutils/testsuite/binutils-all/x86-64/pr27708.exe.bz2

-- 
2.30.2

Comments

H.J. Lu via Binutils April 14, 2021, 10:46 a.m. | #1
Hi H.J.

> bfd/

> 

> 	PR binutils/27708

> 	* elf.c (assign_file_positions_for_non_load_sections): Set

> 	p_memsz to p_filesz for the loadable PT_NOTE segment.

> 

> binutils/

> 

> 	PR binutils/27708

> 	* testsuite/binutils-all/x86-64/pr27708.dump: New file.

> 	* testsuite/binutils-all/x86-64/pr27708.exe.bz2: Likewise.

> 	* testsuite/binutils-all/x86-64/x86-64.exp: Run binutils/27708

> 	test.


Approved - please apply.

Cheers
   Nick

Patch

diff --git a/bfd/elf.c b/bfd/elf.c
index 276fa14c0dd..e762e8d0f23 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -6300,6 +6300,11 @@  assign_file_positions_for_non_load_sections (bfd *abfd,
 		    {
 		      p->p_filesz = (sect->filepos - m->sections[0]->filepos
 				     + hdr->sh_size);
+		      /* NB: p_memsz of the loadable PT_NOTE segment
+			 should be the same as p_filesz.  */
+		      if (p->p_type == PT_NOTE
+			  && (hdr->sh_flags & SHF_ALLOC) != 0)
+			p->p_memsz = p->p_filesz;
 		      break;
 		    }
 		}
diff --git a/binutils/testsuite/binutils-all/x86-64/pr27708.dump b/binutils/testsuite/binutils-all/x86-64/pr27708.dump
new file mode 100644
index 00000000000..e9123df9c42
--- /dev/null
+++ b/binutils/testsuite/binutils-all/x86-64/pr27708.dump
@@ -0,0 +1,33 @@ 
+
+Elf file type is DYN (Shared object file)
+Entry point 0x5f0
+There are 11 program headers, starting at offset 64
+
+Program Headers:
+  Type           Offset   VirtAddr           PhysAddr           FileSiz  MemSiz   Flg Align
+  PHDR           0x000040 0x0000000000000040 0x0000000000000040 0x000268 0x000268 R   0x8
+  INTERP         0x0002a8 0x00000000000002a8 0x00000000000002a8 0x00001c 0x00001c R   0x1
+      [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
+  LOAD           0x000000 0x0000000000000000 0x0000000000000000 0x000938 0x000938 R E 0x1000
+  LOAD           0x000da0 0x0000000000001da0 0x0000000000001da0 0x000278 0x000279 RW  0x1000
+  DYNAMIC        0x000db0 0x0000000000001db0 0x0000000000001db0 0x000210 0x000210 RW  0x8
+  NOTE           0x0002e8 0x00000000000002e8 0x00000000000002e8 0x000030 0x000030 R   0x8
+  NOTE           0x0002c4 0x00000000000002c4 0x00000000000002c4 0x000078 0x000078 R   0x4
+  GNU_EH_FRAME   0x0008ec 0x00000000000008ec 0x00000000000008ec 0x00004c 0x00004c R   0x4
+  GNU_STACK      0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW  0x10
+  TLS            0x000da0 0x0000000000001da0 0x0000000000001da0 0x000000 0x000009 R   0x8
+  GNU_RELRO      0x000da0 0x0000000000001da0 0x0000000000001da0 0x000260 0x000260 RW  0x8
+
+ Section to Segment mapping:
+  Segment Sections...
+   00     
+   01     .interp 
+   02     .interp .note.ABI-tag .note.gnu.property .note.gnu.build-id .dynsym .dynstr .gnu.hash .hash .gnu.version .gnu.version_r .rela.dyn .rela.plt .init .plt .text .fini .rodata .eh_frame .eh_frame_hdr 
+   03     .fini_array .init_array .dynamic .got .got.plt .data .bss 
+   04     .dynamic 
+   05     .note.gnu.property 
+   06     .note.ABI-tag .note.gnu.property .note.gnu.build-id 
+   07     .eh_frame_hdr 
+   08     
+   09     .tbss 
+   10     .fini_array .init_array .dynamic .got 
diff --git a/binutils/testsuite/binutils-all/x86-64/pr27708.exe.bz2 b/binutils/testsuite/binutils-all/x86-64/pr27708.exe.bz2
new file mode 100644
index 0000000000000000000000000000000000000000..94063c6c2852dcb6e782807d13422d2345b72137
GIT binary patch
literal 5815
zcmV;o7D(wrT4*^jL0KkKSt3l@>i`x@fB*mg|NsC0|NsC0|NsC0|NsC0|K9)l*8ly-
z|NsC0|Nr0>FS)qO0N(X9!ca9mXTI&(-QR7Q=`Lv6W9%DdWDIF*vp@g}05mnSL3g2%
z5RD0mrX<8Y0-l>HpOZ>{LrLk0r8lXmvk6aX6ZI#l`kO(OJsyoD(VnNNqt!oBZ&dWe
z$`47Vk5T16RP{Yg8InCFo~NngjWTHbs1Hv{Jdac~(<iB+>NGu1(m|=BWW*W}ObIhY
z^rz~ciRee^1bIWyn^0%~$)Gd?BSS#Y007Wwrhouw00w{n0000027nC)nh`XOCMKZT
zlOgG$F)<j@JpusG14B&%Oh6hMG6P0{Xwyc301XC!$)M2CXahq)00001qd*y{5^7~n
z)jdpr3=EI~paV@ZWW+RR00D>^0078fnqYv?FpUP9XaE2W27oeRXc(FUMvM`FIshI}
z0001J0000000000000000000D0000000000002mlGzbZhX`mGHG6JWHev{OPspBen
zsigf)p-lkM<qVtEJfH{anI4)=KU4vYKn8%w10XbdfB*mh27mw>4Fhx=%igPpI-*XV
zKw29P<HHd=?&U)nhZ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<bf5)Z
znU!YN?+*zEKJtN6C$evhWrQHxXAW$^n@-lQJ!d9XOgWDtf$W@Z8=(^q^X3h_bLa&j
zW|(B6o)`{ty-K<k=V6|mw}jzk_psn?(*)#<<5-X`r^(#V-=0my45V!Uh|A#<N%(W{
zB?Vxz@nZ|gJ{Vwnb-dG?5v#rt=Rq}vgOQffNSa{6AWcDbC@7CjmCV)dFVoOKriv62
zfoE#9IYz4p+$^BxYs0C(kRB0cwN<=9ODO~>t5H^oQm|?Q(v0gRQlzS%OA?gCkbQa+
zI~FD^L!ojQYfOFlif%CRu`s}pllVHbY9_a2*Gp@rA#b6NK`DsYLS#=QAdYn#``j)l
zDYPPix8+_!$4vg32I$Voh!GJH9tT~aI{hc$YNli>iTNZ4j6oA%1dEjE-$Eiv5x$({
zS8pLNKz8QiqUItTIaP$p#P=1D(;y8NJ_Jih&TNE)9Enq3oAK7{s^yp4O{=9$Dpn^-
z(@Om#D(ZHojI3CUj@0WOkboA|pvg{ka-~a7(4Gu!tt-y<k9~Pa-^|)zH?oQZP_<u&
z9!$uwc(d>-ca7cn{~K+a?*D#AWixSU{Hb%>ywAgN2pMJ60BjLZ2zzj!PBiNZTWmC@
zfh=?p0|VFX<?j0wNeKzRd02{{#Rpc}g7X?QdpxWJ!K$f^*jWGZcO+AV2?8X|uCR9x
BoQ(hg

literal 0
HcmV?d00001

diff --git a/binutils/testsuite/binutils-all/x86-64/x86-64.exp b/binutils/testsuite/binutils-all/x86-64/x86-64.exp
index 90fcc84c4f5..29ba1f029c4 100644
--- a/binutils/testsuite/binutils-all/x86-64/x86-64.exp
+++ b/binutils/testsuite/binutils-all/x86-64/x86-64.exp
@@ -58,3 +58,41 @@  if {[catch "system \"bzip2 -dc $t > $tempfile\""] != 0} {
 	}
     }
 }
+
+set t $srcdir/$subdir/pr27708.exe.bz2
+# We need to strip the ".bz2", but can leave the dirname.
+set test $subdir/[file tail $t]
+set testname [file rootname $test]
+verbose $testname
+if {[catch "system \"bzip2 -dc $t > $tempfile\""] != 0} {
+  untested "bzip2 -dc ($testname)"
+} else {
+    send_log "$STRIP $tempfile -o ${tempfile}.strip\n"
+    verbose "$STRIP $tempfile -o ${tempfile}.strip" 1
+    set got [catch "system \"$STRIP $tempfile -o ${tempfile}.strip\""]
+    if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]]} then {
+	fail $testname
+    } else {
+	send_log "$READELF -lW ${tempfile}.strip > tmpdir/pr27708.out 2> /dev/null\n"
+	verbose "$READELF -lW ${tempfile}.strip > tmpdir/pr27708.out 2> /dev/null" 1
+	set got [catch "system \"$READELF -lW ${tempfile}.strip > tmpdir/pr27708.out 2> /dev/null\""]
+
+	if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]]} then {
+	    fail $testname
+	} else {
+	    send_log "cmp tmpdir/pr27708.out $srcdir/$subdir/pr27708.dump\n"
+	    verbose "cmp tmpdir/pr27708.out $srcdir/$subdir/pr26808.dump" 1
+	    set status [remote_exec build cmp "tmpdir/pr27708.out $srcdir/$subdir/pr27708.dump"]
+	    set exec_output [lindex $status 1]
+	    set exec_output [prune_warnings $exec_output]
+
+	    if [string match "" $exec_output] then {
+		pass "strip ($testname)"
+	    } else {
+		send_log "$exec_output\n"
+		verbose "$exec_output" 1
+		fail "strip ($testname)"
+	    }
+	}
+    }
+}