This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: IA64 HP-UX workaround for HP linker bug.
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: binutils at sourceware dot org
- Date: Thu, 2 Feb 2006 16:22:09 -0800 (PST)
- Subject: PATCH: IA64 HP-UX workaround for HP linker bug.
I would like to check in the following patch to fix a GCC problem. The
real bug here is in the HP linker, which looks for SHF_IA_64_HP_TLS as a
thread local flag instead of SHF_TLS. The HP linker has been fixed (it
will accept either flag) but it will take at least a couple of months
before it gets released to customers. In the mean time I was wondering
what people thought about the following patch that allows GCC to work
correctly with TLS on IA64 HP-UX without having to wait for the HP
linker patch.
Tested on IA64 HP-UX with no regressions. OK to check in?
Steve Ellcey
sje@cup.hp.com
include subdirectory:
2006-02-02 Steve Ellcey <sje@cup.hp.com>
* elf/ia64.h (SHF_IA_64_HP_TLS): New.
*** src.orig/include/elf/ia64.h Thu Feb 2 15:25:48 2006
--- src/include/elf/ia64.h Thu Feb 2 15:25:16 2006
***************
*** 57,62 ****
--- 57,63 ----
#define SHF_IA_64_SHORT 0x10000000 /* Section near gp. */
#define SHF_IA_64_NORECOV 0x20000000 /* Spec insns w/o recovery. */
+ #define SHF_IA_64_HP_TLS 0x01000000 /* HP specific TLS flag. */
/* Possible values for sh_type in Elf64_Shdr: */
#define SHT_IA_64_EXT (SHT_LOPROC + 0) /* Extension bits. */
==============================================================================
bfd subdirectory:
2006-02-02 Steve Ellcey <sje@cup.hp.com>
* bfd/elfxx-ia64.c (elfNN_ia64_fake_sections): Set SHF_IA_64_HP_TLS
if SHF_TLS is set.
*** src.orig/bfd/elfxx-ia64.c Thu Feb 2 16:13:25 2006
--- src/bfd/elfxx-ia64.c Thu Feb 2 16:14:13 2006
*************** elfNN_ia64_fake_sections (abfd, hdr, sec
*** 1524,1529 ****
--- 1524,1534 ----
if (sec->flags & SEC_SMALL_DATA)
hdr->sh_flags |= SHF_IA_64_SHORT;
+ /* Some HP linkers look for the SHF_IA_64_HP_TLS flag instead of SHF_TLS. */
+
+ if (elfNN_ia64_hpux_vec (abfd->xvec) && (sec->flags & SHF_TLS))
+ hdr->sh_flags |= SHF_IA_64_HP_TLS;
+
return TRUE;
}