]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - binutils/readelf.c
Properly handle note sections and segments
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 28 Nov 2017 16:18:33 +0000 (08:18 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 28 Nov 2017 16:18:46 +0000 (08:18 -0800)
commit82ed9683ec099d8205dc499ac84febc975235af6
tree30fcfb93563f8b9d8234c75567f67d2cb08e6be4
parentb23dc97fe237a1d9e850d7cbeee066183a00630b
Properly handle note sections and segments

When dumping notes, get note alignment from either note section or note
segment.  To support notes generated by assemblers with

https://sourceware.org/bugzilla/show_bug.cgi?id=22492

we treate alignment as 4 bytes if it is less than 4.  Otherwise, we skip
notes if alignment isn't 4 nor 8 bytes.

We should call load_separate_debug_file only if e_shstrndx != SHN_UNDEF.

PR binutils/22490
* readelf.c (process_notes_at): Add an argument for note
alignment.  If note alignment is less than 4, use 4 byte
alignment.  Otherwise, skip notes if alignment isn't 4 nor
8 bytes.
(process_corefile_note_segments): Pass segment alignment to
process_notes_at.
(process_note_sections): Pass section alignment to
process_notes_at.
(process_object): Call load_separate_debug_file only if
e_shstrndx != SHN_UNDEF.
binutils/ChangeLog
binutils/readelf.c