]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - bfd/coffcode.h
coffcode.h handle_COMDAT tidy
authorAlan Modra <amodra@gmail.com>
Thu, 4 May 2023 09:19:04 +0000 (18:49 +0930)
committerAlan Modra <amodra@gmail.com>
Sat, 20 May 2023 01:19:19 +0000 (10:49 +0930)
commitcb3f0ff4795381fb19e128a85e258149ebed9cd6
treed8a91754ed7ce878e4af1042e743b0615687d3ec
parent880853ed941dc1154e3bb2bd44ddd10b84dfecff
coffcode.h handle_COMDAT tidy

I started down the path of attempting to fix
https://sourceware.org/pipermail/binutils/2023-April/127263.html but
decided after a while that I didn't want to mess with this code..

This patch is a just a few things that I thought worth doing, the main
one being reporting of errors up the call chain.  The while loop to
for loop change is shamelessly stolen from Oleg.

* coffcode.h (handle_COMDAT): Return bool.  Make sec_flags a
flagword*, and adjust to suit.  Replace while loop with for
loop.  Check isym.n_numaux before reading aux entries.  Alloc
coff_comdat_info and name in one call to bfd_alloc.  Remove
goto breakloop.
(styp_to_sec_flags): Adjust handle_COMDAT call.
bfd/coffcode.h