This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[patch] Fix gas/1948 -- Duplicate .comm symbols
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: binutils at sources dot redhat dot com
- Date: Sun, 4 Dec 2005 13:21:58 -0500 (EST)
- Subject: [patch] Fix gas/1948 -- Duplicate .comm symbols
The enclosed fixes Bug gas/1948 on hppa*-*-hpux*. Under HP-UX, common
symbols are supposed to only be defined in the $BSS$ subspace in the
$PRIVATE$ space. There isn't a unique subspace just for common symbols.
In the code in symbols.c that checks for duplicated comm symbols, we
have now_seg = bss_section for the testcase in the bug report.
S_GET_SEGMENT (symbolP) is the BDF segment *COM*. Thus, we never
enter the hunk of code which accepts redefinition of common symbols.
The fix proposed here is to just check to see if now_seg == bss_section.
Tested on hppa2.0w-hp-hpux11.11.
Ok?
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
2005-12-04 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Bug gas/1948
* symbols.c (colon): Check if now_seg is bss_section when the target
is hppa*-*-hpux*.
Index: symbols.c
===================================================================
RCS file: /cvs/src/src/gas/symbols.c,v
retrieving revision 1.71
diff -u -3 -p -r1.71 symbols.c
--- symbols.c 17 Nov 2005 07:29:28 -0000 1.71
+++ symbols.c 3 Dec 2005 22:18:09 -0000
@@ -376,6 +376,9 @@ colon (/* Just seen "x:" - rattle symbol
&& S_IS_EXTERNAL (symbolP))
|| S_GET_SEGMENT (symbolP) == bss_section)
&& (now_seg == data_section
+#if defined (TC_HPPA) && !(defined (OBJ_ELF) && (defined (TE_LINUX) || defined (TE_NetBSD)))
+ || now_seg == bss_section
+#endif
|| now_seg == S_GET_SEGMENT (symbolP)))
{
/* Select which of the 2 cases this is. */