diff options
author | Joern Rennecke <joern.rennecke@embecosm.com> | 2003-03-03 21:04:01 +0000 |
---|---|---|
committer | Joern Rennecke <joern.rennecke@embecosm.com> | 2003-03-03 21:04:01 +0000 |
commit | bdfaef528f42e9c07279aab2f37e3b888a08fc22 (patch) | |
tree | 7d39668f5661d2f58be6c5a8aa5d7e9cb93dc85b /include | |
parent | a0ed55327d141094e07c8cdb3ac6f877109d917c (diff) | |
download | gdb-bdfaef528f42e9c07279aab2f37e3b888a08fc22.zip gdb-bdfaef528f42e9c07279aab2f37e3b888a08fc22.tar.gz gdb-bdfaef528f42e9c07279aab2f37e3b888a08fc22.tar.bz2 |
Fix sh-elf linker relaxation:
gcc:
* config/sh/sh.h (EXTRA_SPECS): Add subtarget_asm_relax_spec and
subtarget_asm_isa_spec.
(SUBTARGET_ASM_RELAX_SPEC, SUBTARGET_ASM_ISA_SPEC): Define.
(ASM_SPEC): Define as SH_ASM_SPEC.
(SH_ASM_SPEC): New; take the role of ASM_SPEC, but safe from svr4.h.
Use subtarget_asm_relax_spec and subtarget_asm_isa_spec.
* config/sh/elf.h (ASM_SPEC): Use SH_ASM_SPEC.
(SUBTARGET_ASM_ISA_SPEC): Undef / define.
gcc/testsuite:
gcc.dg/sh-relax.c: New test.
include/elf:
* sh.h (EF_SH_MERGE_MACH): Make sure SH2E & SH3/SH3E merge to SH3E,
and SH2E & SH4 merge to SH4, not SH2E.
gas:
* config/tc-sh.c (sh_dsp): Replace with preset_target_arch.
(md_begin): Use preset_target_arch.
(md_longopts): Make isa option unconditional.
(md_parse_option): Make OPTION_DSP and OPTION_ISA sh4 / any
set preset_target_arch.
(md_apply_fix3): If BFD_ASSEMBLER, adjust SWITCH_TABLE fixups
by -S_GET_VALUE (fixP->fx_subsy).
(tc_gen_reloc): For SWITCH_TABLE fixups, the symbol is fixp->fx_subsy,
and the addend is 0.
Adjust addend of R_SH_IND12W relocations by fixp->fx_offset - 4.
* config/tc-sh.h (TC_FORCE_RELOCATION_SUB_LOCAL): Define.
bfd:
elf32-sh.c (sh_elf_howto_tab): Make R_SH_IND12W into an ordinary
relocation (no special function), and make it non-partial_inplace.
(sh_elf_relax_section): When creating a bsr, use a consistent value
no matter if the symbol is extern or not; set addend to -4.
Don't swap load / non-load instructions for SH4.
(sh_elf_relax_delete_bytes): In R_SH_IND12W case, check the offset
rather than if the symbol is external to determine if adjusting the
offset makes sense. Adjust the addend too if appropriate.
(sh_elf_relocate_section): In R_SH_IND12W, don't fiddle with the
relocation.
Diffstat (limited to 'include')
-rw-r--r-- | include/elf/ChangeLog | 5 | ||||
-rw-r--r-- | include/elf/sh.h | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog index beb85a7..e87cdd2 100644 --- a/include/elf/ChangeLog +++ b/include/elf/ChangeLog @@ -1,3 +1,8 @@ +Mon Mar 3 20:35:58 2003 J"orn Rennecke <joern.rennecke@superh.com> + + * sh.h (EF_SH_MERGE_MACH): Make sure SH2E & SH3/SH3E merge to SH3E, + and SH2E & SH4 merge to SH4, not SH2E. + 2003-02-21 Ian Wienand <ianw@gelato.unsw.edu.au> * ia64.h (SHT_IA_64_LOPSREG, SHT_IA_64_HIPSREG, diff --git a/include/elf/sh.h b/include/elf/sh.h index 41bf0bf..00a5f2a 100644 --- a/include/elf/sh.h +++ b/include/elf/sh.h @@ -56,7 +56,8 @@ : (((mach1) == EF_SH3E && (mach2) == EF_SH_UNKNOWN) \ || ((mach2) == EF_SH3E && (mach1) == EF_SH_UNKNOWN)) \ ? EF_SH4 \ - : ((mach1) > (mach2) ? (mach1) : (mach2))) + : (((mach1) == EF_SH2E ? 7 : (mach1)) > ((mach2) == EF_SH2E ? 7 : (mach2)) \ + ? (mach1) : (mach2))) /* Flags for the st_other symbol field. Keep away from the STV_ visibility flags (bit 0..1). */ |