* config/tc-arm.c (arm_fix_adjustable) [OBJ_COFF]: Delete.
authorNick Clifton <nickc@redhat.com>
Fri, 10 Nov 2006 09:32:42 +0000 (09:32 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 10 Nov 2006 09:32:42 +0000 (09:32 +0000)
  (arm_fix_adjustable) [OBJ_ELF]: Use it on coff targets too.
* gas/arm/local_label_coff.s: New test.
* gas/arm/local_label_coff.d: New test.
* gas/arm/local_label_elf.s: New test.
* gas/arm/local_label_elf.d: New test.
* gas/arm/local_label_wince.s: New test.
* gas/arm/local_label_wince.d: New test.

gas/ChangeLog
gas/config/tc-arm.c
gas/testsuite/ChangeLog
gas/testsuite/gas/arm/local_label_coff.d [new file with mode: 0644]
gas/testsuite/gas/arm/local_label_coff.s [new file with mode: 0644]
gas/testsuite/gas/arm/local_label_elf.d [new file with mode: 0644]
gas/testsuite/gas/arm/local_label_elf.s [new file with mode: 0644]
gas/testsuite/gas/arm/local_label_wince.d [new file with mode: 0644]
gas/testsuite/gas/arm/local_label_wince.s [new file with mode: 0644]

index db41f68..34a1b8f 100644 (file)
@@ -1,3 +1,8 @@
+2006-11-10  Pedro Alves <pedro_alves@portugalmail.pt>
+
+       * config/tc-arm.c (arm_fix_adjustable) [OBJ_COFF]: Delete.
+       (arm_fix_adjustable) [OBJ_ELF]: Use it on coff targets too.
+
 2006-11-10  Nick Clifton  <nickc@redhat.com>
 
        PR gas/3456:
index 9c534a6..8aa3d41 100644 (file)
@@ -18959,36 +18959,7 @@ arm_force_relocation (struct fix * fixp)
   return generic_force_reloc (fixp);
 }
 
-#ifdef OBJ_COFF
-bfd_boolean
-arm_fix_adjustable (fixS * fixP)
-{
-  /* 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.  */
-  if (fixP->fx_r_type == BFD_RELOC_ARM_ADRL_IMMEDIATE)
-    return 1;
-
-  /* This is a hack for the gas/all/redef2.s test.  This test causes symbols
-     to be cloned, and without this test relocs would still be generated
-     against the original, pre-cloned symbol.  Such symbols would not appear
-     in the symbol table however, and so a valid reloc could not be
-     generated.  So check to see if the fixup is against a symbol which has
-     been removed from the symbol chain, and if it is, then allow it to be
-     adjusted into a reloc against a section symbol. */
-  if (fixP->fx_addsy != NULL
-      && ! S_IS_LOCAL (fixP->fx_addsy)
-      && symbol_next (fixP->fx_addsy) == NULL
-      && symbol_next (fixP->fx_addsy) == symbol_previous (fixP->fx_addsy))
-    return 1;
-  
-  return 0;
-}
-#endif
-
-#ifdef OBJ_ELF
+#if defined (OBJ_ELF) || defined (OBJ_COFF)
 /* Relocations against function names must be left unadjusted,
    so that the linker can use this information to generate interworking
    stubs.  The MIPS version of this function
@@ -19041,6 +19012,9 @@ arm_fix_adjustable (fixS * fixP)
 
   return 1;
 }
+#endif /* defined (OBJ_ELF) || defined (OBJ_COFF) */
+
+#ifdef OBJ_ELF
 
 const char *
 elf32_arm_target_format (void)
index 0a4b608..180fbf9 100644 (file)
@@ -3,6 +3,13 @@
        * gas/arm/undefined.d: Run test on Windows CE.
        * gas/arm/undefined_coff.d: Don't run test on Windows CE.
 
+       * gas/arm/local_label_coff.s: New test.
+       * gas/arm/local_label_coff.d: New test.
+       * gas/arm/local_label_elf.s: New test.
+       * gas/arm/local_label_elf.d: New test.
+       * gas/arm/local_label_wince.s: New test.
+       * gas/arm/local_label_wince.d: New test.
+
 2006-11-09  H.J. Lu  <hongjiu.lu@intel.com>
 
        * gas/i386/sse2.s: Test movdqa with memory destination.
diff --git a/gas/testsuite/gas/arm/local_label_coff.d b/gas/testsuite/gas/arm/local_label_coff.d
new file mode 100644 (file)
index 0000000..5e45ac8
--- /dev/null
@@ -0,0 +1,11 @@
+#nm: -n
+#name: ARM local label relocs to section symbol relocs (COFF)
+# This test is only valid on COFF based targets, except Windows CE.
+# There are ELF and Windows CE versions of this test.
+#not-skip: *-unknown-pe *-epoc-pe *-*-*coff
+
+# Check if relocations against local symbols are converted to 
+# relocations against section symbols.
+0+0 b .bss
+0+0 d .data
+0+0 t .text
diff --git a/gas/testsuite/gas/arm/local_label_coff.s b/gas/testsuite/gas/arm/local_label_coff.s
new file mode 100644 (file)
index 0000000..985f568
--- /dev/null
@@ -0,0 +1,3 @@
+       .text
+Lused_label:
+       .word   Lused_label
diff --git a/gas/testsuite/gas/arm/local_label_elf.d b/gas/testsuite/gas/arm/local_label_elf.d
new file mode 100644 (file)
index 0000000..d4a8c8e
--- /dev/null
@@ -0,0 +1,9 @@
+#nm: -n
+#name: ARM local label relocs to section symbol relocs (ELF)
+# This test is only valid on ELF targets.
+# There are COFF and Windows CE versions of this test.
+#skip: *-*-*coff *-*-pe *-wince-* *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+
+# Check if relocations against local symbols are converted to 
+# relocations against section symbols.
+
diff --git a/gas/testsuite/gas/arm/local_label_elf.s b/gas/testsuite/gas/arm/local_label_elf.s
new file mode 100644 (file)
index 0000000..e9f5467
--- /dev/null
@@ -0,0 +1,3 @@
+       .text
+.Lused_label:
+       .word   .Lused_label
diff --git a/gas/testsuite/gas/arm/local_label_wince.d b/gas/testsuite/gas/arm/local_label_wince.d
new file mode 100644 (file)
index 0000000..97fc58a
--- /dev/null
@@ -0,0 +1,11 @@
+#nm: -n
+#name: ARM local label relocs to section symbol relocs (WinCE)
+# This test is only valid on Windows CE.
+# There are ELF and COFF versions of this test.
+#not-skip: *-*-wince *-wince-*
+
+# Check if relocations against local symbols are converted to 
+# relocations against section symbols.
+0+0 b .bss
+0+0 d .data
+0+0 t .text
diff --git a/gas/testsuite/gas/arm/local_label_wince.s b/gas/testsuite/gas/arm/local_label_wince.s
new file mode 100644 (file)
index 0000000..e9f5467
--- /dev/null
@@ -0,0 +1,3 @@
+       .text
+.Lused_label:
+       .word   .Lused_label