2006-05-11 Paul Brook <paul@codesourcery.com>
authorPaul Brook <paul@codesourcery.com>
Thu, 11 May 2006 15:05:17 +0000 (15:05 +0000)
committerPaul Brook <paul@codesourcery.com>
Thu, 11 May 2006 15:05:17 +0000 (15:05 +0000)
gas/
* config/tc-arm.c (arm_fix_adjustable): Return 0 for function symbols.
gas/testsuite/
* gas/arm/local_function.d: New test.
* gas/arm/local_function.s: New test.

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

index 54ac4a32a1f3481ab081a5fd03cf87dff0ca111c..35a8dbedab358561e0d8c9fdbd894affe9285a78 100644 (file)
@@ -1,3 +1,7 @@
+2006-05-11  Paul Brook  <paul@codesourcery.com>
+
+       * config/tc-arm.c (arm_fix_adjustable): Return 0 for function symbols.
+
 2006-05-11  Thiemo Seufer  <ths@mips.com>
 
        * config/tc-mips.c (append_insn): Don't check the range of j or
index 690f59f7bdfb20b7951c3c52e756d9334ae2e9ad..50940dc47e0a0fb2e992504ac03cedf3cf5dd596 100644 (file)
@@ -17053,9 +17053,9 @@ arm_fix_adjustable (fixS * fixP)
 #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
-   bottom bit of their addresses.  The MIPS version of this function
+/* 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
    also prevents relocations that are mips-16 specific, but I do not
    know why it does this.
 
@@ -17072,6 +17072,10 @@ arm_fix_adjustable (fixS * fixP)
   if (fixP->fx_addsy == NULL)
     return 1;
 
+  /* Preserve relocations against symbols with function type.  */
+  if (symbol_get_bfdsym (fixP->fx_addsy)->flags & BSF_FUNCTION)
+    return 0;
+
   if (THUMB_IS_FUNC (fixP->fx_addsy)
       && fixP->fx_subsy == NULL)
     return 0;
index 9ef3da998503c6abd65721705884c3ac9db9a05b..e9745b114ebd0739592a1580cb67fbcffdaac006 100644 (file)
@@ -1,3 +1,8 @@
+2006-05-11  Paul Brook  <paul@codesourcery.com>
+
+       * gas/arm/local_function.d: New test.
+       * gas/arm/local_function.s: New test.
+
 2006-05-11  Thiemo Seufer  <ths@mips.com>
 
        * gas/mips/jal-range.l: Don't check the range of j or jal
diff --git a/gas/testsuite/gas/arm/local_function.d b/gas/testsuite/gas/arm/local_function.d
new file mode 100644 (file)
index 0000000..46da8ec
--- /dev/null
@@ -0,0 +1,10 @@
+#objdump: -r
+#name: Relocations agains local function symbols
+# This test is only valid on ELF based ports.
+#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+
+.*:     file format.*
+
+RELOCATION RECORDS FOR \[.text\]:
+OFFSET   TYPE              VALUE 
+00000000 R_ARM_(CALL|PC24)        bar
diff --git a/gas/testsuite/gas/arm/local_function.s b/gas/testsuite/gas/arm/local_function.s
new file mode 100644 (file)
index 0000000..1d98a37
--- /dev/null
@@ -0,0 +1,10 @@
+       .text
+       .type foo, %function
+foo:
+       bl bar
+
+       .section .text.bar
+       nop
+       .type bar, %function
+bar:
+       nop