summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Schmidt <bernd.schmidt@analog.com>2010-09-27 15:52:39 +0000
committerBernd Schmidt <bernd.schmidt@analog.com>2010-09-27 15:52:39 +0000
commit252d1ef1d24ac5fd5d39d53369af958bc0b9c5b8 (patch)
tree9f1630b371f88cb66ee974dd5b8052e2dc108e17
parentf5a32cc3351fc5f5ff3964d84a9b49df9bb0930a (diff)
downloadbinutils-redhat-252d1ef1d24ac5fd5d39d53369af958bc0b9c5b8.tar.gz
gas/
* config/tc-tic6x.c (tic6x_fix_adjustable): New function. * config/tc-tic6x.h (tic6x_fix_adjustable): Declare. (tc_fix_adjustable): New macro. gas/testsuite/ * gas/tic6x/got-reloc.s: New test. * gas/tic6x/got-reloc.d: New test.
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-tic6x.c19
-rw-r--r--gas/config/tc-tic6x.h3
-rw-r--r--gas/testsuite/ChangeLog5
-rw-r--r--gas/testsuite/gas/tic6x/got-reloc.d14
-rw-r--r--gas/testsuite/gas/tic6x/got-reloc.s15
6 files changed, 62 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 55a2202142..56d5e411ae 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2010-09-27 Bernd Schmidt <bernds@codesourcery.com>
+
+ * config/tc-tic6x.c (tic6x_fix_adjustable): New function.
+ * config/tc-tic6x.h (tic6x_fix_adjustable): Declare.
+ (tc_fix_adjustable): New macro.
+
2010-09-27 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/tc-s390.c: (md_parse_option): New option -march=z196.
diff --git a/gas/config/tc-tic6x.c b/gas/config/tc-tic6x.c
index ea750ba5c3..f1c28d0d3c 100644
--- a/gas/config/tc-tic6x.c
+++ b/gas/config/tc-tic6x.c
@@ -1591,6 +1591,25 @@ tic6x_init_fix_data (fixS *fixP)
fixP->tc_fix_data.fix_adda = FALSE;
}
+/* Return true if the fix can be handled by GAS, false if it must
+ be passed through to the linker. */
+
+bfd_boolean
+tic6x_fix_adjustable (fixS *fixP)
+{
+ switch (fixP->fx_r_type)
+ {
+ /* Adjust_reloc_syms doesn't know about the GOT. */
+ case BFD_RELOC_C6000_SBR_GOT_U15_W:
+ case BFD_RELOC_C6000_SBR_GOT_H16_W:
+ case BFD_RELOC_C6000_SBR_GOT_L16_W:
+ return 0;
+
+ default:
+ return 1;
+ }
+}
+
/* Given the fine-grained form of an operand, return the coarse
(bit-mask) form. */
diff --git a/gas/config/tc-tic6x.h b/gas/config/tc-tic6x.h
index d4a3795324..a324c0273d 100644
--- a/gas/config/tc-tic6x.h
+++ b/gas/config/tc-tic6x.h
@@ -147,6 +147,9 @@ extern void tic6x_start_line_hook (void);
extern void tic6x_cons_fix_new (fragS *frag, int where, int size,
expressionS *exp);
+#define tc_fix_adjustable(FIX) tic6x_fix_adjustable (FIX)
+extern bfd_boolean tic6x_fix_adjustable (struct fix *);
+
#define tc_frob_label(sym) tic6x_frob_label (sym)
extern void tic6x_frob_label (symbolS *sym);
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 3c8f2c5b13..713ef5858f 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-09-27 Bernd Schmidt <bernds@codesourcery.com>
+
+ * gas/tic6x/got-reloc.s: New test.
+ * gas/tic6x/got-reloc.d: New test.
+
2010-09-27 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* gas/s390/s390.exp: Run the zarch-z196 test.
diff --git a/gas/testsuite/gas/tic6x/got-reloc.d b/gas/testsuite/gas/tic6x/got-reloc.d
new file mode 100644
index 0000000000..d3b5859bff
--- /dev/null
+++ b/gas/testsuite/gas/tic6x/got-reloc.d
@@ -0,0 +1,14 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: C6X GOT relocs
+#as: -march=c674x -mlittle-endian
+
+.*: *file format elf32-tic6x-le
+
+Disassembly of section \.text:
+0+00 <[^>]*> 0000006e[ \t]+ldw \.D2T2 \*\+b14\(0\),b0
+[ \t]*0: R_C6000_SBR_GOT_U15_W[ \t]+\.LC1
+0+04 <[^>]*> 0080002a[ \t]+mvk \.S2 0,b1
+[ \t]*4: R_C6000_SBR_GOT_L16_W[ \t]+\.LC1
+0+08 <[^>]*> 0080006a[ \t]+mvkh \.S2 0,b1
+[ \t]*8: R_C6000_SBR_GOT_H16_W[ \t]+\.LC1
+[ \t]*\.\.\.
diff --git a/gas/testsuite/gas/tic6x/got-reloc.s b/gas/testsuite/gas/tic6x/got-reloc.s
new file mode 100644
index 0000000000..8eceda33f7
--- /dev/null
+++ b/gas/testsuite/gas/tic6x/got-reloc.s
@@ -0,0 +1,15 @@
+# Test that no GOT relocs with an addend are produced.
+ .section .const.str1.1,"aMS",@progbits,1
+.LC0:
+ .string "foo"
+.LC1:
+ .string "bar"
+.text
+.nocmp
+.globl f
+f:
+ ldw .d2t2 *+B14($GOT(.LC1)), B0
+ mvkl .s2 $DPR_GOT(.LC1), B1
+ mvkh .s2 $DPR_GOT(.LC1), B1
+
+