This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] bfd/elf-hppa.h: Cleanup constants and comments


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]