]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
xcoff dynamic symbol string sanity
authorAlan Modra <amodra@gmail.com>
Mon, 7 Apr 2025 00:37:51 +0000 (10:07 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 7 Apr 2025 13:30:23 +0000 (23:00 +0930)
commit464f5083610fa5f10db66d35162294727fc165e9
treeaf165777e792f9bf035d61ecb82f05361029841d
parent1f542289e6762f351c56d2de356f91737c7d1d6f
xcoff dynamic symbol string sanity

Sanity check symbol string table offsets, and tidy structs.  "long"
isn't a good choice for _l_zeroes and _l_offset since it can be 64
bits which blows out the size of the symbol struct unnecessarily.
Also, all of the sizes in internal_ldsym need only be 32 bits, but I
made them size_t because I didn't want to audit all expressions using
them for overflow.

bfd/
* xcofflink.c (_bfd_xcoff_canonicalize_dynamic_symtab): Sanity
check symbol _l_offset.
(xcoff_link_add_dynamic_symbols),
(xcoff_link_check_dynamic_ar_symbols): Likewise.
include/
* coff/xcoff.h (struct internal_ldhdr): Tidy types.
(struct internal_ldsym): Use uint32_t for _l_zeroes and _l_offset.
bfd/xcofflink.c
include/coff/xcoff.h