Prevent local labels from appearing in ARM-COFF objects
Nick Clifton
nickc@redhat.com
Wed Jan 10 17:39:00 GMT 2001
Hi Guys,
Whilst trying to track down a problem with the ARM tests in the gas
testsuite, I discovered that the coff port was emitting the special
symbols created for local labels (by 1: etc). The patch below fixes
this, so that these labels remain truly local, unless actually used
in a relocation.
Cheers
Nick
2001-01-10 Nick Clifton <nickc@redhat.com>
* config/tc-arm.c (arm_fix_adjustable): Define for OBJ_COFF.
* config/tc-arm.h (obj_fix_adjustable): Define for OBJ_COFF
Index: tc-arm.c
===================================================================
RCS file: /cvs/src//src/gas/config/tc-arm.c,v
retrieving revision 1.70
diff -p -r1.70 tc-arm.c
*** tc-arm.c 2000/12/03 06:49:21 1.70
--- tc-arm.c 2001/01/11 01:34:17
*************** arm_validate_fix (fixP)
*** 8537,8542 ****
--- 8537,8558 ----
return false;
}
+ #ifdef OBJ_COFF
+ /* This is a little hack to help the gas/arm/adrl.s test. It prevents
+ local labels from being added to the output symbol table when they
+ are used with the ADRL pseudo op. The ADRL relocation should always
+ be resolved before the binbary is emitted, so it is safe to say that
+ it is adjustable. */
+
+ boolean
+ arm_fix_adjustable (fixP)
+ fixS * fixP;
+ {
+ if (fixP->fx_r_type == BFD_RELOC_ARM_ADRL_IMMEDIATE)
+ return 1;
+ return 0;
+ }
+ #endif
#ifdef OBJ_ELF
/* Relocations against Thumb function names must be left unadjusted,
so that the linker can use this information to correctly set the
Index: tc-arm.h
===================================================================
RCS file: /cvs/src//src/gas/config/tc-arm.h,v
retrieving revision 1.10
diff -p -r1.10 tc-arm.h
*** tc-arm.h 2000/11/17 08:47:51 1.10
--- tc-arm.h 2001/01/11 01:34:17
***************
*** 116,122 ****
#define TC_FIX_TYPE PTR
#define TC_INIT_FIX_DATA(FIXP) ((FIXP)->tc_fix_data = NULL)
! #ifdef OBJ_ELF
#include "write.h" /* For definition of fixS */
#define obj_fix_adjustable(fixP) arm_fix_adjustable (fixP)
boolean arm_fix_adjustable PARAMS ((fixS *));
--- 116,122 ----
#define TC_FIX_TYPE PTR
#define TC_INIT_FIX_DATA(FIXP) ((FIXP)->tc_fix_data = NULL)
! #if defined OBJ_ELF || defined OBJ_COFF
#include "write.h" /* For definition of fixS */
#define obj_fix_adjustable(fixP) arm_fix_adjustable (fixP)
boolean arm_fix_adjustable PARAMS ((fixS *));
More information about the Binutils
mailing list