elf: Set p_memsz to p_filesz for loadable PT_NOTE segment
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 14 Apr 2021 12:30:59 +0000 (05:30 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 14 Apr 2021 12:31:15 +0000 (05:31 -0700)
commit9917b5596a372317c9708c7166cff9dd69b62d5e
tree43350626d6b8db288bbdb35c327a7ed587c8fa6d
parent6be872a439e15d12e86e7c5889f9e0b7804e59c6
elf: Set p_memsz to p_filesz for loadable PT_NOTE segment

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/ChangeLog
bfd/elf.c
binutils/ChangeLog
binutils/testsuite/binutils-all/x86-64/pr27708.dump [new file with mode: 0644]
binutils/testsuite/binutils-all/x86-64/pr27708.exe.bz2 [new file with mode: 0644]
binutils/testsuite/binutils-all/x86-64/x86-64.exp