aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2006-12-01 16:42:26 +0000
committerPaul Brook <paul@codesourcery.com>2006-12-01 16:42:26 +0000
commitf0291e4c153abd12f729d9314338775bfc614f03 (patch)
treeba8c330ee0e3dca36ea743a405ba12759256e1e1
parent945c025aafa9f4f36cdc5bb2f1dad083fa34a6d2 (diff)
downloadgdb-f0291e4c153abd12f729d9314338775bfc614f03.zip
gdb-f0291e4c153abd12f729d9314338775bfc614f03.tar.gz
gdb-f0291e4c153abd12f729d9314338775bfc614f03.tar.bz2
2006-12-01 Paul Brook <paul@codesourcery.com>
gas/ * config/tc-arm.c (arm_force_relocation): Return 1 for relocs against function symbols. gas/testsuite/ * gas/arm/thumbrel.s: New test. * gas/arm/thumbrel.d: New test.
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-arm.c6
-rw-r--r--gas/testsuite/ChangeLog5
-rw-r--r--gas/testsuite/gas/arm/thumbrel.d14
-rw-r--r--gas/testsuite/gas/arm/thumbrel.s11
5 files changed, 41 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index d8066c4..63750db 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2006-12-01 Paul Brook <paul@codesourcery.com>
+
+ * config/tc-arm.c (arm_force_relocation): Return 1 for relocs against
+ function symbols.
+
2006-11-29 Paul Brook <paul@codesourcery.com>
* config/tc-arm.c (arm_is_eabi): New function.
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 8ea3ad1..a7859dc 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -18962,6 +18962,12 @@ arm_force_relocation (struct fix * fixp)
|| fixp->fx_r_type == BFD_RELOC_ARM_LDR_PC_G0)
return 1;
+ /* Always generate relocations against function symbols. */
+ if (fixp->fx_r_type == BFD_RELOC_32
+ && fixp->fx_addsy
+ && (symbol_get_bfdsym (fixp->fx_addsy)->flags & BSF_FUNCTION))
+ return 1;
+
return generic_force_reloc (fixp);
}
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 580dcd9..3abddcd 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2006-12-01 Paul Brook <paul@codesourcery.com>
+
+ * gas/arm/thumbrel.s: New test.
+ * gas/arm/thumbrel.d: New test.
+
2006-11-30 Jan Beulich <jbeulich@novell.com>
* gas/i386/intel.d: Adjust.
diff --git a/gas/testsuite/gas/arm/thumbrel.d b/gas/testsuite/gas/arm/thumbrel.d
new file mode 100644
index 0000000..495360f
--- /dev/null
+++ b/gas/testsuite/gas/arm/thumbrel.d
@@ -0,0 +1,14 @@
+#objdump: -sr
+# 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
+00000004 R_ARM_REL32 b
+
+Contents of section .text:
+ 0000 00000000 (00000004|04000000) 00000000 00000000 .*
+# Ignore .ARM.attributes section
+#...
diff --git a/gas/testsuite/gas/arm/thumbrel.s b/gas/testsuite/gas/arm/thumbrel.s
new file mode 100644
index 0000000..769da16
--- /dev/null
+++ b/gas/testsuite/gas/arm/thumbrel.s
@@ -0,0 +1,11 @@
+@ Check that PC-relative relocs against local function symbols are
+@ generated correctly.
+.text
+.thumb
+a:
+.word 0
+.word b - a
+.word 0
+.word 0
+.type b, %function
+b: