diff options
author | David S. Miller <davem@redhat.com> | 2012-04-12 16:26:06 +0000 |
---|---|---|
committer | David S. Miller <davem@redhat.com> | 2012-04-12 16:26:06 +0000 |
commit | 2615994e91176ae1a147439f81c452e5f5965920 (patch) | |
tree | 39fad336d6e5c3c564bd15e377256d88b737447c /gas/config | |
parent | 214d508ee1d179d6c9e0e993d68628a0bc477124 (diff) | |
download | gdb-2615994e91176ae1a147439f81c452e5f5965920.zip gdb-2615994e91176ae1a147439f81c452e5f5965920.tar.gz gdb-2615994e91176ae1a147439f81c452e5f5965920.tar.bz2 |
Support R_SPARC_WDISP10 and R_SPARC_H34.
include/
* elf/sparc.h (R_SPARC_WDISP10): New reloc.
* opcode/sparc.h: Define '=' as generating R_SPARC_WDISP10.
opcodes/
* sparc-dis.c (X_DISP10): Define.
(print_insn_sparc): Handle '='.
bfd/
* reloc.c (BFD_RELOC_SPARC_H34, BFD_RELOC_SPARC_SIZE32,
BFD_RELOC_SPARC_SIZE64, BFD_RELOC_SPARC_WDISP10): New relocs.
* libbfd.h: Regenerate.
* bfd-in2.h: Likewise.
* elfxx-sparc.c (sparc_elf_wdisp10_reloc): New function.
(_bfd_sparc_elf_howto_table): Add entries for R_SPARC_H34,
R_SPARC_SIZE32, R_SPARC_64, and R_SPARC_WDISP10.
(_bfd_sparc_elf_reloc_type_lookup): Handle new relocs.
(_bfd_sparc_elf_check_relocs): Likewise.
(_bfd_sparc_elf_gc_sweep_hook): Likewise.
(_bfd_sparc_elf_relocate_section): Likewise.
gas/
* config/tc-sparc.c (sparc_ip): Handle '=', "%h34", "%l34", and
BFD_RELOC_SPARC_H34.
(md_apply_fix): Handle BFD_RELOC_SPARC_WDISP10 and BFD_RELOC_SPARC_H34.
(tc_gen_reloc): Likewise.
gas/testsuite/
* gas/sparc/reloc64.s: Add abs34 code model tests.
* gas/sparc/reloc64.d: Update.
elfcpp/
* sparc.h (R_SPARC_WDISP10): New relocation.
gold/
* sparc.cc (Reloc::wdisp10): New relocation method.
(Reloc::h34): Likewise.
(Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
(Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
R_SPARC_WDISP10.
(Target_sparc::Scan::local): Likewise.
(Target_sparc::Scan::global): Likewise.
(Target_sparc::Relocate::relocate): Likewise.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-sparc.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c index f453733..1956dff 100644 --- a/gas/config/tc-sparc.c +++ b/gas/config/tc-sparc.c @@ -1835,6 +1835,11 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn) the_insn.pcrel = 1; goto immediate; + case '=': + the_insn.reloc = /* RELOC_WDISP2_8 */ BFD_RELOC_SPARC_WDISP10; + the_insn.pcrel = 1; + goto immediate; + case 'G': the_insn.reloc = BFD_RELOC_SPARC_WDISP19; the_insn.pcrel = 1; @@ -2418,6 +2423,8 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn) { "hh", 2, BFD_RELOC_SPARC_HH22, 1, 1 }, { "hm", 2, BFD_RELOC_SPARC_HM10, 1, 1 }, { "lm", 2, BFD_RELOC_SPARC_LM22, 1, 1 }, + { "h34", 3, BFD_RELOC_SPARC_H34, 1, 0 }, + { "l34", 3, BFD_RELOC_SPARC_L44, 1, 0 }, { "h44", 3, BFD_RELOC_SPARC_H44, 1, 0 }, { "m44", 3, BFD_RELOC_SPARC_M44, 1, 0 }, { "l44", 3, BFD_RELOC_SPARC_L44, 1, 0 }, @@ -2581,6 +2588,11 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn) val &= 0x3ff; break; + case BFD_RELOC_SPARC_H34: + val >>= 12; + val &= 0x3fffff; + break; + case BFD_RELOC_SPARC_H44: val >>= 22; val &= 0x3fffff; @@ -3360,6 +3372,18 @@ md_apply_fix (fixS *fixP, valueT *valP, segT segment ATTRIBUTE_UNUSED) insn |= val & 0x1f; break; + case BFD_RELOC_SPARC_WDISP10: + if ((val & 3) + || val >= 0x007fc + || val <= -(offsetT) 0x808) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("relocation overflow")); + /* FIXME: The +1 deserves a comment. */ + val = (val >> 2) + 1; + insn |= ((val & 0x300) << 11) + | ((val & 0xff) << 5); + break; + case BFD_RELOC_SPARC_WDISP16: if ((val & 3) || val >= 0x1fffc @@ -3433,6 +3457,15 @@ md_apply_fix (fixS *fixP, valueT *valP, segT segment ATTRIBUTE_UNUSED) insn |= val & 0x3fffff; break; + case BFD_RELOC_SPARC_H34: + if (!fixP->fx_addsy) + { + bfd_vma tval = val; + tval >>= 12; + insn |= tval & 0x3fffff; + } + break; + case BFD_RELOC_SPARC_H44: if (!fixP->fx_addsy) { @@ -3513,6 +3546,7 @@ tc_gen_reloc (asection *section, fixS *fixp) case BFD_RELOC_SPARC_PC22: case BFD_RELOC_SPARC_PC10: case BFD_RELOC_SPARC_BASE13: + case BFD_RELOC_SPARC_WDISP10: case BFD_RELOC_SPARC_WDISP16: case BFD_RELOC_SPARC_WDISP19: case BFD_RELOC_SPARC_WDISP22: @@ -3528,6 +3562,7 @@ tc_gen_reloc (asection *section, fixS *fixp) case BFD_RELOC_SPARC_PC_HH22: case BFD_RELOC_SPARC_PC_HM10: case BFD_RELOC_SPARC_PC_LM22: + case BFD_RELOC_SPARC_H34: case BFD_RELOC_SPARC_H44: case BFD_RELOC_SPARC_M44: case BFD_RELOC_SPARC_L44: @@ -3683,6 +3718,7 @@ tc_gen_reloc (asection *section, fixS *fixp) && code != BFD_RELOC_SPARC_WDISP22 && code != BFD_RELOC_SPARC_WDISP16 && code != BFD_RELOC_SPARC_WDISP19 + && code != BFD_RELOC_SPARC_WDISP10 && code != BFD_RELOC_SPARC_WPLT30 && code != BFD_RELOC_SPARC_TLS_GD_CALL && code != BFD_RELOC_SPARC_TLS_LDM_CALL) |