[committted] Correct flag bit in HP-UX 11 PA-RISC .tbss special section

John David Anglin dave@hiauly1.hia.nrc.ca
Mon Mar 20 09:14:00 GMT 2006


The following is a correction for the flag bits for the .tbss section
in HP-UX 11 PA-RISC.  This was noticed comparing readelf output for
a program linked with HP ld and GNU ld.

Tested on hppa2.0w-hp-hpux11.11 with no regressions.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
-------------- next part --------------
2006-03-19  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	* elf64-hppa.c (elf64_hppa_special_sections): Change flags for .tbss
	section from SHF_PARISC_WEAKORDER to SHF_HP_TLS.
	(elf_backend_special_sections): Remove #undef.

Index: elf64-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-hppa.c,v
retrieving revision 1.69
diff -u -3 -p -r1.69 elf64-hppa.c
--- elf64-hppa.c	18 Mar 2006 18:53:46 -0000	1.69
+++ elf64-hppa.c	19 Mar 2006 22:08:59 -0000
@@ -2703,7 +2710,7 @@ static const struct bfd_elf_special_sect
   { ".dlt",    4, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT },
   { ".sdata",  6, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT },
   { ".sbss",   5, 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT },
-  { ".tbss",   5, 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_WEAKORDER },
+  { ".tbss",   5, 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_HP_TLS },
   { NULL,      0, 0, 0,            0 }
 };
 
@@ -2814,7 +2821,5 @@ const struct elf_size_info hppa64_elf_si
 #undef TARGET_BIG_NAME
 #define TARGET_BIG_NAME			"elf64-hppa-linux"
 
-#undef elf_backend_special_sections
-
 #define INCLUDED_TARGET_FILE 1
 #include "elf64-target.h"
-------------- next part --------------
2006-03-19  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	* hppa.h (SHF_HP_TLS, SHF_HP_NEAR_SHARED, SHF_HP_FAR_SHARED,
	SHF_HP_COMDAT, SHF_HP_CONST, SHN_TLS_COMMON, SHN_NS_COMMON,
	SHN_NS_UNDEF, SHN_FS_UNDEF, SHN_HP_EXTERN, SHN_HP_EXTHINT,
	SHN_HP_UNDEF_BIND_IMM, SHT_HP_OVLBITS, SHT_HP_DLKM, SHT_HP_COMDAT,
	SHT_HP_OBJDICT, SHT_HP_ANNOT, STB_HP_ALIAS): Define.

Index: hppa.h
===================================================================
RCS file: /cvs/src/src/include/elf/hppa.h,v
retrieving revision 1.19
diff -u -3 -p -r1.19 hppa.h
--- hppa.h	7 Nov 2005 00:08:35 -0000	1.19
+++ hppa.h	19 Mar 2006 22:56:05 -0000
@@ -490,6 +490,30 @@ typedef enum elf_hppa_reloc_type elf_hpp
 #define PT_PARISC_UNWIND	0x70000001
 #define PT_PARISC_WEAKORDER	0x70000002
 
+/* Flag bits in sh_flags of ElfXX_Shdr.  */
+#define SHF_HP_TLS              0x01000000
+#define SHF_HP_NEAR_SHARED      0x02000000
+#define SHF_HP_FAR_SHARED       0x04000000
+#define SHF_HP_COMDAT           0x08000000
+#define SHF_HP_CONST            0x00800000
+
+/* Reserved section header indices.  */
+#define SHN_TLS_COMMON          (SHN_LOOS + 0x0)
+#define SHN_NS_COMMON           (SHN_LOOS + 0x1)
+#define SHN_FS_COMMON           (SHN_LOOS + 0x2)
+#define SHN_NS_UNDEF            (SHN_LOOS + 0x3)
+#define SHN_FS_UNDEF            (SHN_LOOS + 0x4)
+#define SHN_HP_EXTERN           (SHN_LOOS + 0x5)
+#define SHN_HP_EXTHINT          (SHN_LOOS + 0x6)
+#define SHN_HP_UNDEF_BIND_IMM   (SHN_LOOS + 0x7)
+
+/* Values of sh_type in ElfXX_Shdr.  */
+#define SHT_HP_OVLBITS  (SHT_LOOS + 0x0)
+#define SHT_HP_DLKM     (SHT_LOOS + 0x1)
+#define SHT_HP_COMDAT   (SHT_LOOS + 0x2)
+#define SHT_HP_OBJDICT  (SHT_LOOS + 0x3)
+#define SHT_HP_ANNOT    (SHT_LOOS + 0x4)
+
 /* Flag bits in p_flags of ElfXX_Phdr.  */
 #define PF_HP_CODE		0x00040000
 #define PF_HP_MODIFY		0x00080000
@@ -571,6 +595,9 @@ typedef enum elf_hppa_reloc_type elf_hpp
 #define PT_HP_STACK		(PT_LOOS + 0x14)
 #define PT_HP_CORE_UTSNAME	(PT_LOOS + 0x15)
 
+/* Binding information.  */
+#define STB_HP_ALIAS		(STB_LOOS + 0x0)
+
 /* Additional symbol types.  */
 #define STT_HP_OPAQUE		(STT_LOOS + 0x1)
 #define STT_HP_STUB		(STT_LOOS + 0x2)


More information about the Binutils mailing list