This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] bfd/elf-hppa.h: Cleanup constants and comments
- From: Nick Clifton <nickc at redhat dot com>
- To: Helge Deller <deller at gmx dot de>, binutils at sourceware dot org
- Cc: John David Anglin <dave dot anglin at bell dot net>, Alan Modra <amodra at gmail dot com>
- Date: Tue, 21 Aug 2018 15:30:37 +0100
- Subject: Re: [PATCH] bfd/elf-hppa.h: Cleanup constants and comments
- References: <20180814160833.GA21525@ls3530>
Hi Helge,
> Minor cleanups. Please commit if Ok.
Actually I have a couple of questions:
> #if ARCH_SIZE == 64
> - hdr->sh_type = SHT_LOPROC + 1;
> + hdr->sh_type = SHT_LOPROC + SHT_PROGBITS;
The sh_type field is a single value, not a bitfield, so constructing a value
like this is wrong. A better solution, I would suggest, is to use the already
defined value for this particular field. IE:
hdr->sh_type = SHT_PARISC_UNWIND;
> #else
> - hdr->sh_type = 1;
> + hdr->sh_type = SHT_PROGBITS;
> #endif
This is OK.
> - /* I have no idea if this is really necessary or what it means. */
> + /* Size of one unwind table entry is 16 (=2^4) bytes. */
> hdr->sh_entsize = 4;
But if the unwind table entries are 16 bytes long, when why isn't the
sh_entry field set to 16 ? I think that the comment should explain
why 4 is the correct value (or else change the sh_entsize field to 16,
if that is the correct thing to do).
Cheers
Nick