aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-07-07 17:03:21 +0000
committerIan Lance Taylor <ian@airs.com>1995-07-07 17:03:21 +0000
commit5767cfb748416544cb8ae12a68b256a55f3f8856 (patch)
tree30fb67d31f796eec041b519f526320450d0b33ed /gas
parentcebf05ad1cf33d37fa3367cf994c501f6af218d4 (diff)
downloadgdb-5767cfb748416544cb8ae12a68b256a55f3f8856.zip
gdb-5767cfb748416544cb8ae12a68b256a55f3f8856.tar.gz
gdb-5767cfb748416544cb8ae12a68b256a55f3f8856.tar.bz2
Add SPARC ELF PIC support.
* write.c (fixup_segment): Pass fixP to TC_RELOC_RTSYM_LOC_FIXUP, not fixP->fx_r_type. * config/tc-sparc.c (sparc_pic_code): New global variable. (md_apply_fix): If generating PIC, adjust fx_addnumber for any non PC relative reloc. (tc_gen_reloc): If generating PIC, adjust various reloc types. Remove fx_pcrel assert, since it is no longer true. (md_parse_option): Handle -K PIC. * config/tc-sparc.h (sparc_pic_code): Declare if OBJ_ELF. (TC_RELOC_RTSYM_LOC_FIXUP): Define if OBJ_ELF. (tc_fix_adjustable): Don't adjust PC relative relocs if PIC. * config/tc-i386.h (TC_RELOC_RTSYM_LOC_FIXUP): Take a fixp, not a reloc type. PR 7131.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog15
-rw-r--r--gas/config/tc-i386.h10
-rw-r--r--gas/write.c5
3 files changed, 23 insertions, 7 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 50b5dca..e61efb0 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,20 @@
Fri Jul 7 11:17:27 1995 Ian Lance Taylor <ian@cygnus.com>
+ Add SPARC ELF PIC support.
+ * write.c (fixup_segment): Pass fixP to TC_RELOC_RTSYM_LOC_FIXUP,
+ not fixP->fx_r_type.
+ * config/tc-sparc.c (sparc_pic_code): New global variable.
+ (md_apply_fix): If generating PIC, adjust fx_addnumber for any non
+ PC relative reloc.
+ (tc_gen_reloc): If generating PIC, adjust various reloc types.
+ Remove fx_pcrel assert, since it is no longer true.
+ (md_parse_option): Handle -K PIC.
+ * config/tc-sparc.h (sparc_pic_code): Declare if OBJ_ELF.
+ (TC_RELOC_RTSYM_LOC_FIXUP): Define if OBJ_ELF.
+ (tc_fix_adjustable): Don't adjust PC relative relocs if PIC.
+ * config/tc-i386.h (TC_RELOC_RTSYM_LOC_FIXUP): Take a fixp, not a
+ reloc type.
+
* Makefile.in (Makefile): Add dependency on conf.in, so that conf
is rebuilt when conf.in changes.
diff --git a/gas/config/tc-i386.h b/gas/config/tc-i386.h
index 85fc584..c3e84fb 100644
--- a/gas/config/tc-i386.h
+++ b/gas/config/tc-i386.h
@@ -1,5 +1,5 @@
/* tc-i386.h -- Header file for tc-i386.c
- Copyright (C) 1989, 1992 Free Software Foundation.
+ Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation.
This file is part of GAS, the GNU Assembler.
@@ -53,10 +53,10 @@
checked here. I am not sure if some of the others are ever used with
pcrel, but it is easier to be safe than sorry. */
-#define TC_RELOC_RTSYM_LOC_FIXUP(X) \
- ((X) != BFD_RELOC_386_PLT32 && \
- (X) != BFD_RELOC_386_GOT32 && \
- (X) != BFD_RELOC_386_GOTPC)
+#define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \
+ ((FIX)->fx_r_type != BFD_RELOC_386_PLT32 \
+ && (FIX)->fx_r_type != BFD_RELOC_386_GOT32 \
+ && (FIX)->fx_r_type != BFD_RELOC_386_GOTPC)
#define TARGET_ARCH bfd_arch_i386
#define TARGET_BYTES_BIG_ENDIAN 0
diff --git a/gas/write.c b/gas/write.c
index f74a93e..702aaa2 100644
--- a/gas/write.c
+++ b/gas/write.c
@@ -1,5 +1,6 @@
/* write.c - emit .o file
- Copyright (C) 1986, 87, 90, 91, 92, 93, 1994 Free Software Foundation, Inc.
+ Copyright (C) 1986, 87, 90, 91, 92, 93, 94, 1995
+ Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -2243,7 +2244,7 @@ fixup_segment (fixP, this_segment_type)
if (add_symbolP)
{
if (add_symbol_segment == this_segment_type && pcrel && !plt
- && TC_RELOC_RTSYM_LOC_FIXUP (fixP->fx_r_type))
+ && TC_RELOC_RTSYM_LOC_FIXUP (fixP))
{
/*
* This fixup was made when the symbol's segment was