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


On 2018-08-21 5:19 PM, Helge Deller wrote:
On 21.08.2018 16:30, Nick Clifton wrote:
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;
Agreed. Much better!
  #else
-      hdr->sh_type = 1;
+      hdr->sh_type = SHT_PROGBITS;
  #endif
This is OK.
Ok.
Actually, now that Nick has pointed it out I'm a bit puzzled why the latter case isn't SHT_PARISC_UNWIND as well.  I recognize that changing the type might break something but it seems logical.

There are a couple of defines in include/elf/hppa.h that have the same issue.

Dave

--
John David Anglin  dave.anglin@bell.net


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