Use the correct constants when setting the section type of HPPA unwind sections.
authorHelge Deller <deller@gmx.de>
Wed, 22 Aug 2018 09:32:53 +0000 (10:32 +0100)
committerNick Clifton <nickc@redhat.com>
Wed, 22 Aug 2018 09:32:53 +0000 (10:32 +0100)
* elf-hppa.h (elf_hppa_fake_sections): Use SHT_PARISC_UNWIND as
the section type of the .PARISC.unwind section on 64-bit binaries
and SHT_PROGBITS for 32-bit binaries.  Add a comment about it.
Add comment about the sh_entsize value.

bfd/ChangeLog
bfd/elf-hppa.h

index 6946a65ad1426b6efe2a1e121f77d632ff091b94..97ad1a09f5d4bb16c8e24c8197872c326a7113e1 100644 (file)
@@ -1,3 +1,11 @@
+2018-08-22  Helge Deller  <deller@gmx.de>
+       Nick Clifton  <nickc@redhat.com>
+
+       * elf-hppa.h (elf_hppa_fake_sections): Use SHT_PARISC_UNWIND as
+       the section type of the .PARISC.unwind section on 64-bit binaries
+       and SHT_PROGBITS for 32-bit binaries.  Add a comment about it.
+       Add comment about the sh_entsize value.
+
 2018-08-22  Rafeal Auler  <rafaelauler@gmail.com>
 
        PR 23560
index 9f34a030cc8c0ca292bc57addeab43426ee105ca..3b72140e5f2440dcdf2a5020d1c2d0bfbaf3227f 100644 (file)
@@ -889,9 +889,11 @@ elf_hppa_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec)
       asection *asec;
 
 #if ARCH_SIZE == 64
-      hdr->sh_type = SHT_LOPROC + 1;
+      hdr->sh_type = SHT_PARISC_UNWIND;
 #else
-      hdr->sh_type = 1;
+      /* Note - it is not clear why this is not SHT_PARISC_UNWIND as well.
+        Presumably it is a historical constraint, so leave it as it is.  */
+      hdr->sh_type = SHT_PROGBITS;
 #endif
       /* ?!? How are unwinds supposed to work for symbols in arbitrary
         sections?  Or what if we have multiple .text sections in a single
@@ -912,7 +914,10 @@ elf_hppa_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec)
            }
        }
 
-      /* I have no idea if this is really necessary or what it means.  */
+      /* The unwind table entries are 16 bytes long, so it is not clear
+        why this field is set to 4.  (The ELF spec says that the sh_entsize
+        field is a byte quantity, but this is a processor specific section,
+        so it is allowed to change the rules).  Leave as it is for now.  */
       hdr->sh_entsize = 4;
     }
   return TRUE;
This page took 0.032495 seconds and 4 git commands to generate.