Commit: Code Tidy: bfd/elf.c core note code
Nick Clifton
nickc@redhat.com
Fri Aug 15 13:03:01 GMT 2025
Hi Guys,
I am applying the attached patch to tidy up the core note handling
code in bfd/elf.c. The patch does not add any new functionality,
it just tidies things up. In particular the patch:
* Replaces repeated uses of a constant string with a #define,
helping to eliminate possible future typographical errors
and making the purpose of the string more obvious.
* Replaces uses of strcmp() to test for string equality with a
macro called streq(), making the code easier to read.
* Replaces extended sequences of similar if..then statements
with a static table and a simple loop, making it easier to
add future core note types. Plus the tables are alpha
sorted, so it is easier to find a specific note type.
Tested by compiling lots of differently targeted versions of the
binutils and running the testsuites looking for regressions.
Cheers
Nick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: elf.c.patch
Type: text/x-patch
Size: 74489 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20250815/8e40dc3b/attachment-0001.bin>
More information about the Binutils
mailing list