From e8d53f09e3c74aa574a36d87fc829e536e968ce4 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Thu, 3 Oct 1996 08:07:38 +0000 Subject: Ugly hack alert! libg++'s exception code causes gcc to generate (ahem!) non-conventional assembler code in -fpic mode that gas and ld choke on. Basically, gas and ld require than symbols referenced in the GOT (global offset table) are actually global (as the name implies). It attempted to work around it before, but didn't quite go far enough to prevent a core dump in ld. This hack causes GOT referenced symbols to be forced global. This probably breaks the __EXCEPTION_TABLE__ stuff in pic mode, but heck, it wasn't even possible to compile with a shared library before at all. I'm not 100% sure what the bug is. There's two possibilities: 1: gcc/cp/exception.c has to be fixed to stop doing GOT references to local symbols, or 2: as/ld/symorder/ld.so etc need to be taught about how to keep local symbols around so that they can be dealt with in GOT references. John Polstra's elfkit stuff seems to deal with this fine though, which is why I think it's a "missing feature" in our hacked gas and ld.. --- gnu/usr.bin/as/config/tc-i386.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnu/usr.bin/as/config/tc-i386.c b/gnu/usr.bin/as/config/tc-i386.c index e0c71d7086ea9..8d3982e1ea1e6 100644 --- a/gnu/usr.bin/as/config/tc-i386.c +++ b/gnu/usr.bin/as/config/tc-i386.c @@ -25,7 +25,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: tc-i386.c,v 1.4 1995/05/30 04:47:29 rgrimes Exp $"; +static char rcsid[] = "$Id: tc-i386.c,v 1.5 1996/10/01 00:12:43 peter Exp $"; #endif #include "as.h" @@ -2082,6 +2082,7 @@ relax_addressT segment_address_in_file; if (!extrn_bit && !S_IS_EXTERNAL(fixP->fx_addsy)) as_warn("GOT relocation burb: `%s' should be global", S_GET_NAME(fixP->fx_addsy)); + S_SET_EXTERNAL(fixP->fx_addsy); extrn_bit = 1; break; case RELOC_GOTOFF: -- cgit v1.3