diff options
author | Bernd Schmidt <bernds@codesourcery.com> | 2010-09-27 15:52:40 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@codesourcery.com> | 2010-09-27 15:52:40 +0000 |
commit | 43bb514a1cc9641dfdb0f3ac20de48e2c17c0135 (patch) | |
tree | 6653486e8201395216f4f5b90d6aa6b0426d54c4 /gas | |
parent | d9aee5d7f73be87d56ac14e0179afbd0dd59cb75 (diff) | |
download | gdb-43bb514a1cc9641dfdb0f3ac20de48e2c17c0135.zip gdb-43bb514a1cc9641dfdb0f3ac20de48e2c17c0135.tar.gz gdb-43bb514a1cc9641dfdb0f3ac20de48e2c17c0135.tar.bz2 |
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.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 6 | ||||
-rw-r--r-- | gas/config/tc-tic6x.c | 19 | ||||
-rw-r--r-- | gas/config/tc-tic6x.h | 3 | ||||
-rw-r--r-- | gas/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/tic6x/got-reloc.d | 14 | ||||
-rw-r--r-- | gas/testsuite/gas/tic6x/got-reloc.s | 15 |
6 files changed, 62 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 55a2202..56d5e41 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 ea750ba..f1c28d0 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 d4a3795..a324c02 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 3c8f2c5..713ef58 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 0000000..d3b5859 --- /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 0000000..8eceda3 --- /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 + + |