]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
PR32260: Improve error handling on string merging
authorMichael Matz <matz@suse.de>
Tue, 15 Oct 2024 16:47:15 +0000 (18:47 +0200)
committerMichael Matz <matz@suse.de>
Thu, 17 Oct 2024 14:41:37 +0000 (16:41 +0200)
commited3228de9b3335e5c97f738fc22d682f56d42316
treec22f5c1428e6f7a2f44854faedeb483ba48eac76
parent34f93a568c4a3b264025e36f099bc29e94929e2a
PR32260: Improve error handling on string merging

if the input sections are near the max supported size (4G)
we might fail to enlarge the hash table.  The error handling
for this case didn't quite work.  When this happens we can
gracefully fall back to just not deduplicate this section
(and continue with further mergable sections).  We were mixing
that with the case of not being able to even allocate a small
structure (in which case we can as well error out completely),
this disentables both cases.

bfd/

PR ld/32260
* merge.c (sec_merge_maybe_resize): Check overflow in ultimate
target type.
(record_section): Return three-state, use new state when unable
to enlarge hash table.
(_bfd_merge_sections): Remove current section from merging
consideration when hashtable can't be enlarged.
bfd/merge.c