From 2615994e91176ae1a147439f81c452e5f5965920 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Thu, 12 Apr 2012 16:26:06 +0000 Subject: 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. --- opcodes/sparc-dis.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'opcodes/sparc-dis.c') diff --git a/opcodes/sparc-dis.c b/opcodes/sparc-dis.c index b7f0cc2..7857e4c 100644 --- a/opcodes/sparc-dis.c +++ b/opcodes/sparc-dis.c @@ -129,6 +129,7 @@ static char *v9a_asr_reg_names[] = /* These are for v9. */ #define X_DISP16(i) (((((i) >> 20) & 3) << 14) | (((i) >> 0) & 0x3fff)) +#define X_DISP10(i) (((((i) >> 19) & 3) << 8) | (((i) >> 5) & 0xff)) #define X_DISP19(i) (((i) >> 0) & 0x7ffff) #define X_MEMBAR(i) ((i) & 0x7f) @@ -743,6 +744,11 @@ print_insn_sparc (bfd_vma memaddr, disassemble_info *info) break; } + case '=': + info->target = memaddr + SEX (X_DISP10 (insn), 10) * 4; + (*info->print_address_func) (info->target, info); + break; + case 'k': info->target = memaddr + SEX (X_DISP16 (insn), 16) * 4; (*info->print_address_func) (info->target, info); -- cgit v1.1