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.