diff options
author | David S. Miller <davem@redhat.com> | 2008-04-16 08:51:18 +0000 |
---|---|---|
committer | David S. Miller <davem@redhat.com> | 2008-04-16 08:51:18 +0000 |
commit | 739f7f82beda72a2702c814d5a8af90a91b1c30d (patch) | |
tree | 223b463a3e96dd2b75666140540c090a9ecd5b64 /gas/config | |
parent | 14a6d8e0dfbb4359a08c77c46e335dbce4c36cfc (diff) | |
download | gdb-739f7f82beda72a2702c814d5a8af90a91b1c30d.zip gdb-739f7f82beda72a2702c814d5a8af90a91b1c30d.tar.gz gdb-739f7f82beda72a2702c814d5a8af90a91b1c30d.tar.bz2 |
bfd/
* reloc.c (BFD_RELOC_SPARC_GOTDATA_HIX22,
BFD_RELOC_SPARC_GOTDATA_LOX10, BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
BFD_RELOC_SPARC_GOTDATA_OP_LOX10, BFD_RELOC_SPARC_GOTDATA_OP): New.
* libbfd.h: Regnerate.
* bfd-in2.h: Regenerate.
* elfxx-sparc.c (_bfd_sparc_elf_howto_table): Add entries for
GOTDATA relocations.
(sparc_reloc_map): Likewise.
(_bfd_sparc_elf_check_relocs): Handle R_SPARC_GOTDATA_* like
R_SPARC_GOT*.
(_bfd_sparc_elf_gc_sweep_hook): Likewise.
(_bfd_sparc_elf_relocate_section): Transform R_SPARC_GOTDATA_HIX22,
R_SPARC_GOTDATA_LOX10, R_SPARC_GOTDATA_OP_HIX22, and
R_SPARC_GOTDATA_OP_LOX10 into the equivalent R_SPARC_GOT* reloc.
Simply ignore R_SPARC_GOTDATA_OP relocations.
gas/
* config/tc-sparc.c (sparc_ip): Add support for gotdata mnemonics
and relocation generation.
(tc_gen_reloc): Likewise.
gas/testsuite/
* gas/sparc/gotops32.d: New.
* gas/sparc/gotops32.s: Likewise.
* gas/sparc/gotops64.d: Likewise.
* gas/sparc/gotops64.s: Likewise.
* gas/sparc/sparc.exp: Run new gotdata tests.
ld/testsuite/
* ld-sparc/gotop32.dd: New.
* ld-sparc/gotop32.rd: Likewise.
* ld-sparc/gotop32.s: Likewise.
* ld-sparc/gotop32.sd: Likewise.
* ld-sparc/gotop32.td: Likewise.
* ld-sparc/gotop64.dd: Likewise.
* ld-sparc/gotop64.rd: Likewise.
* ld-sparc/gotop64.s: Likewise.
* ld-sparc/gotop64.sd: Likewise.
* ld-sparc/gotop64.td: Likewise.
* ld-sparc/sparc.exp: Run new gotdata tests.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-sparc.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c index e81b1f0..50a469f 100644 --- a/gas/config/tc-sparc.c +++ b/gas/config/tc-sparc.c @@ -1860,7 +1860,7 @@ sparc_ip (str, pinsn) case '\0': /* End of args. */ if (s[0] == ',' && s[1] == '%') { - static const struct tls_ops + static const struct ops { /* The name as it appears in assembler. */ char *name; @@ -1868,10 +1868,10 @@ sparc_ip (str, pinsn) int len; /* The reloc this pseudo-op translates to. */ int reloc; - /* 1 if call. */ - int call; + /* 1 if tls call. */ + int tls_call; } - tls_ops[] = + ops[] = { { "tgd_add", 7, BFD_RELOC_SPARC_TLS_GD_ADD, 0 }, { "tgd_call", 8, BFD_RELOC_SPARC_TLS_GD_CALL, 1 }, @@ -1881,13 +1881,14 @@ sparc_ip (str, pinsn) { "tie_ldx", 7, BFD_RELOC_SPARC_TLS_IE_LDX, 0 }, { "tie_ld", 6, BFD_RELOC_SPARC_TLS_IE_LD, 0 }, { "tie_add", 7, BFD_RELOC_SPARC_TLS_IE_ADD, 0 }, + { "gdop", 4, BFD_RELOC_SPARC_GOTDATA_OP, 0 }, { NULL, 0, 0, 0 } }; - const struct tls_ops *o; + const struct ops *o; char *s1; int npar = 0; - for (o = tls_ops; o->name; o++) + for (o = ops; o->name; o++) if (strncmp (s + 2, o->name, o->len) == 0) break; if (o->name == NULL) @@ -1899,14 +1900,14 @@ sparc_ip (str, pinsn) return special_case; } - if (! o->call && the_insn.reloc != BFD_RELOC_NONE) + if (! o->tls_call && the_insn.reloc != BFD_RELOC_NONE) { as_bad (_("Illegal operands: %%%s cannot be used together with other relocs in the insn ()"), o->name); return special_case; } - if (o->call + if (o->tls_call && (the_insn.reloc != BFD_RELOC_32_PCREL_S2 || the_insn.exp.X_add_number != 0 || the_insn.exp.X_add_symbol @@ -2328,6 +2329,10 @@ sparc_ip (str, pinsn) { "tie_lo10", 8, BFD_RELOC_SPARC_TLS_IE_LO10, 0, 0 }, { "tle_hix22", 9, BFD_RELOC_SPARC_TLS_LE_HIX22, 0, 0 }, { "tle_lox10", 9, BFD_RELOC_SPARC_TLS_LE_LOX10, 0, 0 }, + { "gdop_hix22", 10, BFD_RELOC_SPARC_GOTDATA_OP_HIX22, + 0, 0 }, + { "gdop_lox10", 10, BFD_RELOC_SPARC_GOTDATA_OP_LOX10, + 0, 0 }, { NULL, 0, 0, 0, 0 } }; const struct ops *o; @@ -3445,6 +3450,9 @@ tc_gen_reloc (section, fixp) case BFD_RELOC_SPARC_TLS_LE_LOX10: case BFD_RELOC_SPARC_TLS_DTPOFF32: case BFD_RELOC_SPARC_TLS_DTPOFF64: + case BFD_RELOC_SPARC_GOTDATA_OP_HIX22: + case BFD_RELOC_SPARC_GOTDATA_OP_LOX10: + case BFD_RELOC_SPARC_GOTDATA_OP: code = fixp->fx_r_type; break; default: |