2010-05-21 Daniel Jacobowitz <dan@codesourcery.com>

Joseph Myers  <joseph@codesourcery.com>
            Andrew Stubbs  <ams@codesourcery.com>

        bfd/
        * config.bfd (sh-*-uclinux* | sh[12]-*-uclinux*): Add
        bfd_elf32_shl_vec, and FDPIC vectors to targ_selvecs.
        * configure.in: Handle FDPIC vectors.
        * elf32-sh-relocs.h: Add FDPIC and movi20 relocations.
        * elf32-sh.c (DEFAULT_STACK_SIZE): Define.
        (SYMBOL_FUNCDESC_LOCAL): Define.  Use it instead of
        SYMBOL_REFERENCES_LOCAL for function descriptors.
        (fdpic_object_p): New.
        (sh_reloc_map): Add FDPIC and movi20 relocations.
        (sh_elf_info_to_howto, sh_elf_relocate_section): Handle new invalid
        range.
        (struct elf_sh_plt_info): Add got20 and short_plt.  Update all
        definitions.
        (FDPIC_PLT_ENTRY_SIZE, FDPIC_PLT_LAZY_OFFSET): Define.
        (fdpic_sh_plt_entry_be, fdpic_sh_plt_entry_le, fdpic_sh_plts): New.
        (FDPIC_SH2A_PLT_ENTRY_SIZE, FDPIC_SH2A_PLT_LAZY_OFFSET): Define.
        (fdpic_sh2a_plt_entry_be, fdpic_sh2a_plt_entry_le)
        (fdpic_sh2a_short_plt_be, fdpic_sh2a_short_plt_le, fdpic_sh2a_plts):
        New.
        (get_plt_info): Handle FDPIC.
        (MAX_SHORT_PLT): Define.
        (get_plt_index, get_plt_offset): Handle short_plt.
        (union gotref): New.
        (struct elf_sh_link_hash_entry): Add funcdesc, rename tls_type to
        got_type and adjust all uses.  Add GOT_FUNCDESC.
        (struct sh_elf_obj_tdata): Add local_funcdesc.  Rename
        local_got_tls_type to local_got_type.
        (sh_elf_local_got_type): Renamed from sh_elf_local_got_tls_type.  All
        users changed.
        (sh_elf_local_funcdesc): Define.
        (struct elf_sh_link_hash_table): Add sfuncdesc, srelfuncdesc, fdpic_p,
        and srofixup.
        (sh_elf_link_hash_newfunc): Initialize new fields.
        (sh_elf_link_hash_table_create): Set fdpic_p.
        (sh_elf_omit_section_dynsym): New.
        (create_got_section): Create .got.funcdesc, .rela.got.funcdesc
        and .rofixup.
        (allocate_dynrelocs): Allocate local function descriptors and space
        for R_SH_FUNCDESC-related relocations, and for rofixups.
        Handle GOT_FUNCDESC.  Create fixups.  Handle GOT entries which
        require function descriptors.
        (sh_elf_always_size_sections): Handle PT_GNU_STACK and __stacksize.
        (sh_elf_modify_program_headers): New.
        (sh_elf_size_dynamic_sections): Allocate function descriptors for
        local symbols.  Allocate .got.funcdesc contents.  Allocate rofixups.
        Handle local GOT entries of type GOT_FUNCDESC.  Create fixups for
        local GOT entries.  Ensure that FDPIC libraries always have a PLTGOT
        entry in the .dynamic section.
        (sh_elf_add_dyn_reloc, sh_elf_got_offset, sh_elf_initialize_funcdesc)
        (sh_elf_add_rofixup, sh_elf_osec_to_segment)
        (sh_elf_osec_readonly_p, install_movi20_field): New functions.
        (sh_elf_relocate_section): Handle new relocations, R_SH_FUNCDESC,
        R_SH_GOTFUNCDESC and R_SH_GOTOFFFUNCDESC.  Use sh_elf_got_offset
        and .got.plt throughout to find _GLOBAL_OFFSET_TABLE_.  Add rofixup
        read-only section warnings.  Handle undefined weak symbols.  Generate
        fixups for R_SH_DIR32 and GOT entries.  Check for cross-segment
        relocations and clear EF_SH_PIC.  Handle 20-bit relocations.
        Always generate R_SH_DIR32 for FDPIC instead of R_SH_RELATIVE.
        (sh_elf_gc_sweep_hook): Handle R_SH_FUNCDESC, R_SH_GOTOFF20,
        R_SH_GOTFUNCDESC, R_SH_GOTFUNCDESC20, and R_SH_GOTOFFFUNCDESC.
        Handle 20-bit relocations.
        (sh_elf_copy_indirect_symbol): Copy function descriptor reference
        counts.
        (sh_elf_check_relocs): Handle new relocations.  Make symbols
        dynamic for FDPIC relocs.  Account for rofixups.  Error for FDPIC
        symbol mismatches.  Allocate a GOT for R_SH_DIR32. Allocate fixups
        for R_SH_DIR32.
        (sh_elf_copy_private_data): Copy PT_GNU_STACK size.
        (sh_elf_merge_private_data): Copy initial flags.  Do not clobber
        non-mach flags.  Set EF_SH_PIC for FDPIC.  Reject FDPIC mismatches.
        (sh_elf_finish_dynamic_symbol): Do not handle got_funcdesc entries
        here.  Rename sgot to sgotplt and srel to srelplt.  Handle short_plt,
        FDPIC descriptors, and got20.  Create R_SH_FUNCDESC_VALUE for FDPIC.
        Use install_movi20_field.  Rename srel to srelgot.  Always generate
        R_SH_DIR32 for FDPIC instead of R_SH_RELATIVE.
        (sh_elf_finish_dynamic_sections): Fill in the GOT pointer in rofixup.
        Do not fill in reserved GOT entries for FDPIC.  Correct DT_PLTGOT.
        Rename sgot to sgotplt.  Assert that the right number of rofixups
        and dynamic relocations were allocated.
        (sh_elf_use_relative_eh_frame, sh_elf_encode_eh_address): New.
        (elf_backend_omit_section_dynsym): Use sh_elf_omit_section_dynsym.
        (elf_backend_can_make_relative_eh_frame)
        (elf_backend_can_make_lsda_relative_eh_frame)
        (elf_backend_encode_eh_address): Define.
        (TARGET_BIG_SYM, TARGET_BIG_NAME, TARGET_LITTLE_SYM)
        (TARGET_LITTLE_NAME, elf_backend_modify_program_headers, elf32_bed):
        Redefine for FDPIC vector.
        * reloc.c: Add SH FDPIC and movi20 relocations.
        * targets.c (_bfd_target_vector): Add FDPIC vectors.
        * configure, bfd-in2.h, libbfd.h: Regenerated.

        binutils/
        * readelf.c (get_machine_flags): Handle EF_SH_PIC and EF_SH_FDPIC.

        gas/
        * config/tc-sh.c (sh_fdpic): New.
        (sh_check_fixup): Handle relocations on movi20.
        (parse_exp): Do not reject PIC operators here.
        (build_Mytes): Check for unhandled PIC operators here.  Use
        sh_check_fixup for movi20.
        (enum options): Add OPTION_FDPIC.
        (md_longopts, md_parse_option, md_show_usage): Add --fdpic.
        (sh_fix_adjustable, md_apply_fix): Handle FDPIC and movi20 relocations.
        (sh_elf_final_processing): Handle --fdpic.
        (sh_uclinux_target_format): New.
        (sh_parse_name): Handle FDPIC relocation operators.
        * config/tc-sh.h (TARGET_FORMAT): Define specially for TE_UCLINUX.
        (sh_uclinux_target_format): Declare for TE_UCLINUX.
        * configure.tgt (sh-*-uclinux* | sh[12]-*-uclinux*): Set
        em=uclinux.
        * doc/c-sh.texi (SH Options): Document --fdpic.

        gas/testsuite/
        * gas/sh/basic.exp: Run new tests.  Handle uClinux like Linux.
        * gas/sh/fdpic.d: New file.
        * gas/sh/fdpic.s: New file.
        * gas/sh/reg-prefix.d: Force big-endian.
        * gas/sh/sh2a-pic.d: New file.
        * gas/sh/sh2a-pic.s: New file.
        * lib/gas-defs.exp (is_elf_format): Include sh*-*-uclinux*.

        include/elf/
        * sh.h (EF_SH_PIC, EF_SH_FDPIC): Define.
        (R_SH_FIRST_INVALID_RELOC_6, R_SH_LAST_INVALID_RELOC_6): New.  Adjust
        other invalid ranges.
        (R_SH_GOT20, R_SH_GOTOFF20, R_SH_GOTFUNCDESC, R_SH_GOTFUNCDESC20)
        (R_SH_GOTOFFFUNCDESC, R_SH_GOTOFFFUNCDESC20, R_SH_FUNCDESC)
        (R_SH_FUNCDESC_VALUE): New.

        ld/
        * Makefile.am (ALL_EMULATIONS): Add eshelf_fd.o and eshlelf_fd.o.
        (eshelf_fd.c, eshlelf_fd.c): New rules.
        * Makefile.in: Regenerate.
        * configure.tgt (sh-*-uclinux*): Add shelf_fd and shlelf_fd
        emulations.
        * emulparams/shelf_fd.sh: New file.
        * emulparams/shlelf_fd.sh: New file.
        * emulparams/shlelf_linux.sh: Update comment.

        ld/testsuite/
        * ld-sh/sh.exp: Handle uClinux like Linux.
        * lib/ld-lib.exp (is_elf_format): Include sh*-*-uclinux*.
        * ld-sh/fdpic-funcdesc-shared.d: New file.
        * ld-sh/fdpic-funcdesc-shared.s: New file.
        * ld-sh/fdpic-funcdesc-static.d: New file.
        * ld-sh/fdpic-funcdesc-static.s: New file.
        * ld-sh/fdpic-gotfuncdesc-shared.d: New file.
        * ld-sh/fdpic-gotfuncdesc-shared.s: New file.
        * ld-sh/fdpic-gotfuncdesc-static.d: New file.
        * ld-sh/fdpic-gotfuncdesc-static.s: New file.
        * ld-sh/fdpic-gotfuncdesci20-shared.d: New file.
        * ld-sh/fdpic-gotfuncdesci20-shared.s: New file.
        * ld-sh/fdpic-gotfuncdesci20-static.d: New file.
        * ld-sh/fdpic-gotfuncdesci20-static.s: New file.
        * ld-sh/fdpic-goti20-shared.d: New file.
        * ld-sh/fdpic-goti20-shared.s: New file.
        * ld-sh/fdpic-goti20-static.d: New file.
        * ld-sh/fdpic-goti20-static.s: New file.
        * ld-sh/fdpic-gotofffuncdesc-shared.d: New file.
        * ld-sh/fdpic-gotofffuncdesc-shared.s: New file.
        * ld-sh/fdpic-gotofffuncdesc-static.d: New file.
        * ld-sh/fdpic-gotofffuncdesc-static.s: New file.
        * ld-sh/fdpic-gotofffuncdesci20-shared.d: New file.
        * ld-sh/fdpic-gotofffuncdesci20-shared.s: New file.
        * ld-sh/fdpic-gotofffuncdesci20-static.d: New file.
        * ld-sh/fdpic-gotofffuncdesci20-static.s: New file.
        * ld-sh/fdpic-gotoffi20-shared.d: New file.
        * ld-sh/fdpic-gotoffi20-shared.s: New file.
        * ld-sh/fdpic-gotoffi20-static.d: New file.
        * ld-sh/fdpic-gotoffi20-static.s: New file.
        * ld-sh/fdpic-plt-be.d: New file.
        * ld-sh/fdpic-plt-le.d: New file.
        * ld-sh/fdpic-plt.s: New file.
        * ld-sh/fdpic-plti20-be.d: New file.
        * ld-sh/fdpic-plti20-le.d: New file.
        * ld-sh/fdpic-stack-default.d: New file.
        * ld-sh/fdpic-stack-size.d: New file.
        * ld-sh/fdpic-stack.s: New file.
This commit is contained in:
Nick Clifton 2010-05-25 14:12:43 +00:00
parent 52a6ecd218
commit 8e45593ff3
71 changed files with 3218 additions and 242 deletions

View File

@ -1,3 +1,98 @@
2010-05-25 Daniel Jacobowitz <dan@codesourcery.com>
Joseph Myers <joseph@codesourcery.com>
Andrew Stubbs <ams@codesourcery.com>
* config.bfd (sh-*-uclinux* | sh[12]-*-uclinux*): Add
bfd_elf32_shl_vec, and FDPIC vectors to targ_selvecs.
* configure.in: Handle FDPIC vectors.
* elf32-sh-relocs.h: Add FDPIC and movi20 relocations.
* elf32-sh.c (DEFAULT_STACK_SIZE): Define.
(SYMBOL_FUNCDESC_LOCAL): Define. Use it instead of
SYMBOL_REFERENCES_LOCAL for function descriptors.
(fdpic_object_p): New.
(sh_reloc_map): Add FDPIC and movi20 relocations.
(sh_elf_info_to_howto, sh_elf_relocate_section): Handle new invalid
range.
(struct elf_sh_plt_info): Add got20 and short_plt. Update all
definitions.
(FDPIC_PLT_ENTRY_SIZE, FDPIC_PLT_LAZY_OFFSET): Define.
(fdpic_sh_plt_entry_be, fdpic_sh_plt_entry_le, fdpic_sh_plts): New.
(FDPIC_SH2A_PLT_ENTRY_SIZE, FDPIC_SH2A_PLT_LAZY_OFFSET): Define.
(fdpic_sh2a_plt_entry_be, fdpic_sh2a_plt_entry_le)
(fdpic_sh2a_short_plt_be, fdpic_sh2a_short_plt_le, fdpic_sh2a_plts):
New.
(get_plt_info): Handle FDPIC.
(MAX_SHORT_PLT): Define.
(get_plt_index, get_plt_offset): Handle short_plt.
(union gotref): New.
(struct elf_sh_link_hash_entry): Add funcdesc, rename tls_type to
got_type and adjust all uses. Add GOT_FUNCDESC.
(struct sh_elf_obj_tdata): Add local_funcdesc. Rename
local_got_tls_type to local_got_type.
(sh_elf_local_got_type): Renamed from sh_elf_local_got_tls_type. All
users changed.
(sh_elf_local_funcdesc): Define.
(struct elf_sh_link_hash_table): Add sfuncdesc, srelfuncdesc, fdpic_p,
and srofixup.
(sh_elf_link_hash_newfunc): Initialize new fields.
(sh_elf_link_hash_table_create): Set fdpic_p.
(sh_elf_omit_section_dynsym): New.
(create_got_section): Create .got.funcdesc, .rela.got.funcdesc
and .rofixup.
(allocate_dynrelocs): Allocate local function descriptors and space
for R_SH_FUNCDESC-related relocations, and for rofixups.
Handle GOT_FUNCDESC. Create fixups. Handle GOT entries which
require function descriptors.
(sh_elf_always_size_sections): Handle PT_GNU_STACK and __stacksize.
(sh_elf_modify_program_headers): New.
(sh_elf_size_dynamic_sections): Allocate function descriptors for
local symbols. Allocate .got.funcdesc contents. Allocate rofixups.
Handle local GOT entries of type GOT_FUNCDESC. Create fixups for
local GOT entries. Ensure that FDPIC libraries always have a PLTGOT
entry in the .dynamic section.
(sh_elf_add_dyn_reloc, sh_elf_got_offset, sh_elf_initialize_funcdesc)
(sh_elf_add_rofixup, sh_elf_osec_to_segment)
(sh_elf_osec_readonly_p, install_movi20_field): New functions.
(sh_elf_relocate_section): Handle new relocations, R_SH_FUNCDESC,
R_SH_GOTFUNCDESC and R_SH_GOTOFFFUNCDESC. Use sh_elf_got_offset
and .got.plt throughout to find _GLOBAL_OFFSET_TABLE_. Add rofixup
read-only section warnings. Handle undefined weak symbols. Generate
fixups for R_SH_DIR32 and GOT entries. Check for cross-segment
relocations and clear EF_SH_PIC. Handle 20-bit relocations.
Always generate R_SH_DIR32 for FDPIC instead of R_SH_RELATIVE.
(sh_elf_gc_sweep_hook): Handle R_SH_FUNCDESC, R_SH_GOTOFF20,
R_SH_GOTFUNCDESC, R_SH_GOTFUNCDESC20, and R_SH_GOTOFFFUNCDESC.
Handle 20-bit relocations.
(sh_elf_copy_indirect_symbol): Copy function descriptor reference
counts.
(sh_elf_check_relocs): Handle new relocations. Make symbols
dynamic for FDPIC relocs. Account for rofixups. Error for FDPIC
symbol mismatches. Allocate a GOT for R_SH_DIR32. Allocate fixups
for R_SH_DIR32.
(sh_elf_copy_private_data): Copy PT_GNU_STACK size.
(sh_elf_merge_private_data): Copy initial flags. Do not clobber
non-mach flags. Set EF_SH_PIC for FDPIC. Reject FDPIC mismatches.
(sh_elf_finish_dynamic_symbol): Do not handle got_funcdesc entries
here. Rename sgot to sgotplt and srel to srelplt. Handle short_plt,
FDPIC descriptors, and got20. Create R_SH_FUNCDESC_VALUE for FDPIC.
Use install_movi20_field. Rename srel to srelgot. Always generate
R_SH_DIR32 for FDPIC instead of R_SH_RELATIVE.
(sh_elf_finish_dynamic_sections): Fill in the GOT pointer in rofixup.
Do not fill in reserved GOT entries for FDPIC. Correct DT_PLTGOT.
Rename sgot to sgotplt. Assert that the right number of rofixups
and dynamic relocations were allocated.
(sh_elf_use_relative_eh_frame, sh_elf_encode_eh_address): New.
(elf_backend_omit_section_dynsym): Use sh_elf_omit_section_dynsym.
(elf_backend_can_make_relative_eh_frame)
(elf_backend_can_make_lsda_relative_eh_frame)
(elf_backend_encode_eh_address): Define.
(TARGET_BIG_SYM, TARGET_BIG_NAME, TARGET_LITTLE_SYM)
(TARGET_LITTLE_NAME, elf_backend_modify_program_headers, elf32_bed):
Redefine for FDPIC vector.
* reloc.c: Add SH FDPIC and movi20 relocations.
* targets.c (_bfd_target_vector): Add FDPIC vectors.
* configure, bfd-in2.h, libbfd.h: Regenerated.
2010-05-25 Jay Krell <jay.krell@cornell.edu>
PR ld/11624

View File

@ -3276,6 +3276,13 @@ pc-relative or some form of GOT-indirect relocation. */
BFD_RELOC_SH_TLS_DTPMOD32,
BFD_RELOC_SH_TLS_DTPOFF32,
BFD_RELOC_SH_TLS_TPOFF32,
BFD_RELOC_SH_GOT20,
BFD_RELOC_SH_GOTOFF20,
BFD_RELOC_SH_GOTFUNCDESC,
BFD_RELOC_SH_GOTFUNCDESC20,
BFD_RELOC_SH_GOTOFFFUNCDESC,
BFD_RELOC_SH_GOTOFFFUNCDESC20,
BFD_RELOC_SH_FUNCDESC,
/* ARC Cores relocs.
ARC 22 bit pc-relative branch. The lowest two bits must be zero and are

View File

@ -1257,7 +1257,7 @@ case "${targ}" in
sh-*-uclinux* | sh[12]-*-uclinux*)
targ_defvec=bfd_elf32_sh_vec
targ_selvecs="bfd_elf32_shblin_vec bfd_elf32_shlin_vec"
targ_selvecs="bfd_elf32_shl_vec bfd_elf32_shblin_vec bfd_elf32_shlin_vec bfd_elf32_shfd_vec bfd_elf32_shbfd_vec"
#ifdef BFD64
targ_selvecs="${targ_selvecs} bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec"
#endif

2
bfd/configure vendored
View File

@ -15135,7 +15135,9 @@ do
bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;;
bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;;
bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shbfd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shblin_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shfd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shl_symbian_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;

View File

@ -772,7 +772,9 @@ do
bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;;
bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;;
bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shbfd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shblin_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shfd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shl_symbian_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;

View File

@ -1,4 +1,4 @@
/* Copyright 2006, 2007 Free Software Foundation, Inc.
/* Copyright 2006, 2007, 2010 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -1462,19 +1462,164 @@
0, /* src_mask */
((bfd_vma) 0) - 1, /* dst_mask */
FALSE), /* pcrel_offset */
#else
EMPTY_HOWTO (169),
EMPTY_HOWTO (170),
EMPTY_HOWTO (171),
EMPTY_HOWTO (172),
EMPTY_HOWTO (173),
EMPTY_HOWTO (174),
EMPTY_HOWTO (175),
EMPTY_HOWTO (176),
EMPTY_HOWTO (177),
EMPTY_HOWTO (178),
EMPTY_HOWTO (179),
EMPTY_HOWTO (180),
EMPTY_HOWTO (181),
EMPTY_HOWTO (182),
EMPTY_HOWTO (183),
EMPTY_HOWTO (184),
EMPTY_HOWTO (185),
EMPTY_HOWTO (186),
EMPTY_HOWTO (187),
EMPTY_HOWTO (188),
EMPTY_HOWTO (189),
EMPTY_HOWTO (190),
EMPTY_HOWTO (191),
EMPTY_HOWTO (192),
EMPTY_HOWTO (193),
EMPTY_HOWTO (194),
EMPTY_HOWTO (195),
EMPTY_HOWTO (196),
#endif
EMPTY_HOWTO (197),
EMPTY_HOWTO (198),
EMPTY_HOWTO (199),
EMPTY_HOWTO (200),
EMPTY_HOWTO (201),
EMPTY_HOWTO (202),
EMPTY_HOWTO (203),
EMPTY_HOWTO (204),
EMPTY_HOWTO (205),
EMPTY_HOWTO (206),
EMPTY_HOWTO (207),
EMPTY_HOWTO (208),
/* FDPIC-relative offset to a GOT entry, for movi20. */
HOWTO (R_SH_GOT20, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_SH_GOT20", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
0x00f0ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* FDPIC-relative offset to a data object, for movi20. */
HOWTO (R_SH_GOTOFF20, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_SH_GOTOFF20", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
0x00f0ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* FDPIC-relative offset to a GOT entry for a function descriptor. */
HOWTO (R_SH_GOTFUNCDESC, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_SH_GOTFUNCDESC", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* FDPIC-relative offset to a GOT entry for a function descriptor,
for movi20. */
HOWTO (R_SH_GOTFUNCDESC20, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_SH_GOTFUNCDESC20", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
0x00f0ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* FDPIC-relative offset to a function descriptor. */
HOWTO (R_SH_GOTOFFFUNCDESC, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_SH_GOTOFFFUNCDESC", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* FDPIC-relative offset to a function descriptor, for movi20. */
HOWTO (R_SH_GOTOFFFUNCDESC20, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_SH_GOTOFFFUNCDESC20", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
0x00f0ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* Address of an official function descriptor. */
HOWTO (R_SH_FUNCDESC, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_SH_FUNCDESC", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* Function descriptor to be filled in by the dynamic linker. */
HOWTO (R_SH_FUNCDESC_VALUE, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
64, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_SH_FUNCDESC_VALUE", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
#ifdef INCLUDE_SHMEDIA
EMPTY_HOWTO (209),
EMPTY_HOWTO (210),
EMPTY_HOWTO (211),

File diff suppressed because it is too large Load Diff

View File

@ -1511,6 +1511,13 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_SH_TLS_DTPMOD32",
"BFD_RELOC_SH_TLS_DTPOFF32",
"BFD_RELOC_SH_TLS_TPOFF32",
"BFD_RELOC_SH_GOT20",
"BFD_RELOC_SH_GOTOFF20",
"BFD_RELOC_SH_GOTFUNCDESC",
"BFD_RELOC_SH_GOTFUNCDESC20",
"BFD_RELOC_SH_GOTOFFFUNCDESC",
"BFD_RELOC_SH_GOTOFFFUNCDESC20",
"BFD_RELOC_SH_FUNCDESC",
"BFD_RELOC_ARC_B22_PCREL",
"BFD_RELOC_ARC_B26",
"BFD_RELOC_BFIN_16_IMM",

View File

@ -3255,6 +3255,20 @@ ENUMX
BFD_RELOC_SH_TLS_DTPOFF32
ENUMX
BFD_RELOC_SH_TLS_TPOFF32
ENUMX
BFD_RELOC_SH_GOT20
ENUMX
BFD_RELOC_SH_GOTOFF20
ENUMX
BFD_RELOC_SH_GOTFUNCDESC
ENUMX
BFD_RELOC_SH_GOTFUNCDESC20
ENUMX
BFD_RELOC_SH_GOTOFFFUNCDESC
ENUMX
BFD_RELOC_SH_GOTOFFFUNCDESC20
ENUMX
BFD_RELOC_SH_FUNCDESC
ENUMDOC
Renesas / SuperH SH relocs. Not all of these appear in object files.

View File

@ -663,7 +663,9 @@ extern const bfd_target bfd_elf32_sh64blin_vec;
extern const bfd_target bfd_elf32_sh64lnbsd_vec;
extern const bfd_target bfd_elf32_sh64nbsd_vec;
extern const bfd_target bfd_elf32_sh_vec;
extern const bfd_target bfd_elf32_shbfd_vec;
extern const bfd_target bfd_elf32_shblin_vec;
extern const bfd_target bfd_elf32_shfd_vec;
extern const bfd_target bfd_elf32_shl_vec;
extern const bfd_target bfd_elf32_shl_symbian_vec;
extern const bfd_target bfd_elf32_shlin_vec;
@ -1003,7 +1005,9 @@ static const bfd_target * const _bfd_target_vector[] =
&bfd_elf32_littlescore_vec,
#endif
&bfd_elf32_sh_vec,
&bfd_elf32_shbfd_vec,
&bfd_elf32_shblin_vec,
&bfd_elf32_shfd_vec,
&bfd_elf32_shl_vec,
&bfd_elf32_shl_symbian_vec,
&bfd_elf32_shlin_vec,

View File

@ -1,3 +1,9 @@
2010-05-25 Daniel Jacobowitz <dan@codesourcery.com>
Joseph Myers <joseph@codesourcery.com>
Andrew Stubbs <ams@codesourcery.com>
* readelf.c (get_machine_flags): Handle EF_SH_PIC and EF_SH_FDPIC.
2010-05-25 Jay Krell <jay.krell@cornell.edu>
PR ld/11621

View File

@ -2440,6 +2440,11 @@ get_machine_flags (unsigned e_flags, unsigned e_machine)
default: strcat (buf, _(", unknown ISA")); break;
}
if (e_flags & EF_SH_PIC)
strcat (buf, ", pic");
if (e_flags & EF_SH_FDPIC)
strcat (buf, ", fdpic");
break;
case EM_SH:

View File

@ -1,3 +1,24 @@
2010-05-25 Daniel Jacobowitz <dan@codesourcery.com>
Joseph Myers <joseph@codesourcery.com>
Andrew Stubbs <ams@codesourcery.com>
* config/tc-sh.c (sh_fdpic): New.
(sh_check_fixup): Handle relocations on movi20.
(parse_exp): Do not reject PIC operators here.
(build_Mytes): Check for unhandled PIC operators here. Use
sh_check_fixup for movi20.
(enum options): Add OPTION_FDPIC.
(md_longopts, md_parse_option, md_show_usage): Add --fdpic.
(sh_fix_adjustable, md_apply_fix): Handle FDPIC and movi20 relocations.
(sh_elf_final_processing): Handle --fdpic.
(sh_uclinux_target_format): New.
(sh_parse_name): Handle FDPIC relocation operators.
* config/tc-sh.h (TARGET_FORMAT): Define specially for TE_UCLINUX.
(sh_uclinux_target_format): Declare for TE_UCLINUX.
* configure.tgt (sh-*-uclinux* | sh[12]-*-uclinux*): Set
em=uclinux.
* doc/c-sh.texi (SH Options): Document --fdpic.
2010-05-25 Jay Krell <jay.krell@cornell.edu>
PR ld/11621

View File

@ -145,6 +145,9 @@ static unsigned int preset_target_arch;
accommodate the insns seen so far. */
static unsigned int valid_arch;
/* Whether --fdpic was given. */
static int sh_fdpic;
const char EXP_CHARS[] = "eE";
/* Chars that mean this number is a floating point constant. */
@ -612,7 +615,6 @@ sh_check_fixup (expressionS *main_exp, bfd_reloc_code_real_type *r_type_p)
if (exp->X_op == O_PIC_reloc)
{
#ifdef HAVE_SH64
switch (*r_type_p)
{
case BFD_RELOC_NONE:
@ -620,6 +622,31 @@ sh_check_fixup (expressionS *main_exp, bfd_reloc_code_real_type *r_type_p)
*r_type_p = exp->X_md;
break;
case BFD_RELOC_SH_DISP20:
switch (exp->X_md)
{
case BFD_RELOC_32_GOT_PCREL:
*r_type_p = BFD_RELOC_SH_GOT20;
break;
case BFD_RELOC_32_GOTOFF:
*r_type_p = BFD_RELOC_SH_GOTOFF20;
break;
case BFD_RELOC_SH_GOTFUNCDESC:
*r_type_p = BFD_RELOC_SH_GOTFUNCDESC20;
break;
case BFD_RELOC_SH_GOTOFFFUNCDESC:
*r_type_p = BFD_RELOC_SH_GOTOFFFUNCDESC20;
break;
default:
abort ();
}
break;
#ifdef HAVE_SH64
case BFD_RELOC_SH_IMM_LOW16:
switch (exp->X_md)
{
@ -715,13 +742,11 @@ sh_check_fixup (expressionS *main_exp, bfd_reloc_code_real_type *r_type_p)
abort ();
}
break;
#endif
default:
abort ();
}
#else
*r_type_p = exp->X_md;
#endif
if (exp == main_exp)
exp->X_op = O_symbol;
else
@ -1358,12 +1383,6 @@ parse_exp (char *s, sh_operand_info *op)
expression (&op->immediate);
if (op->immediate.X_op == O_absent)
as_bad (_("missing operand"));
#ifdef OBJ_ELF
else if (op->immediate.X_op == O_PIC_reloc
|| sh_PIC_related_p (op->immediate.X_add_symbol)
|| sh_PIC_related_p (op->immediate.X_op_symbol))
as_bad (_("misplaced PIC operand"));
#endif
new_pointer = input_line_pointer;
input_line_pointer = save;
return new_pointer;
@ -2327,6 +2346,8 @@ build_Mytes (sh_opcode_info *opcode, sh_operand_info *operand)
unsigned int size = 2;
int low_byte = target_big_endian ? 1 : 0;
int max_index = 4;
bfd_reloc_code_real_type r_type;
int unhandled_pic = 0;
nbuf[0] = 0;
nbuf[1] = 0;
@ -2337,6 +2358,14 @@ build_Mytes (sh_opcode_info *opcode, sh_operand_info *operand)
nbuf[6] = 0;
nbuf[7] = 0;
for (indx = 0; indx < 3; indx++)
if (opcode->arg[indx] == A_IMM
&& operand[indx].type == A_IMM
&& (operand[indx].immediate.X_op == O_PIC_reloc
|| sh_PIC_related_p (operand[indx].immediate.X_add_symbol)
|| sh_PIC_related_p (operand[indx].immediate.X_op_symbol)))
unhandled_pic = 1;
if (SH_MERGE_ARCH_SET (opcode->arch, arch_op32))
{
output = frag_more (4);
@ -2415,7 +2444,11 @@ build_Mytes (sh_opcode_info *opcode, sh_operand_info *operand)
case IMM0_20_4:
break;
case IMM0_20:
insert4 (output, BFD_RELOC_SH_DISP20, 0, operand);
r_type = BFD_RELOC_SH_DISP20;
if (sh_check_fixup (&operand->immediate, &r_type))
as_bad (_("Invalid PIC expression."));
unhandled_pic = 0;
insert4 (output, r_type, 0, operand);
break;
case IMM0_20BY8:
insert4 (output, BFD_RELOC_SH_DISP20BY8, 0, operand);
@ -2474,6 +2507,8 @@ build_Mytes (sh_opcode_info *opcode, sh_operand_info *operand)
}
}
}
if (unhandled_pic)
as_bad (_("misplaced PIC operand"));
if (!target_big_endian)
{
output[1] = (nbuf[0] << 4) | (nbuf[1]);
@ -3098,6 +3133,9 @@ enum options
OPTION_PT32,
#endif
OPTION_H_TICK_HEX,
#ifdef OBJ_ELF
OPTION_FDPIC,
#endif
OPTION_DUMMY /* Not used. This is just here to make it easy to add and subtract options from this enum. */
};
@ -3126,6 +3164,10 @@ struct option md_longopts[] =
#endif /* HAVE_SH64 */
{ "h-tick-hex", no_argument, NULL, OPTION_H_TICK_HEX },
#ifdef OBJ_ELF
{"fdpic", no_argument, NULL, OPTION_FDPIC},
#endif
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
@ -3259,6 +3301,12 @@ md_parse_option (int c, char *arg ATTRIBUTE_UNUSED)
enable_h_tick_hex = 1;
break;
#ifdef OBJ_ELF
case OPTION_FDPIC:
sh_fdpic = TRUE;
break;
#endif /* OBJ_ELF */
default:
return 0;
}
@ -3311,6 +3359,10 @@ SH options:\n\
--expand-pt32 with -abi=64, expand PT, PTA and PTB instructions\n\
to 32 bits only\n"));
#endif /* HAVE_SH64 */
#ifdef OBJ_ELF
fprintf (stream, _("\
--fdpic generate an FDPIC object file\n"));
#endif /* OBJ_ELF */
}
/* This struct is used to pass arguments to sh_count_relocs through
@ -3804,7 +3856,13 @@ sh_fix_adjustable (fixS *fixP)
{
if (fixP->fx_r_type == BFD_RELOC_32_PLT_PCREL
|| fixP->fx_r_type == BFD_RELOC_32_GOT_PCREL
|| fixP->fx_r_type == BFD_RELOC_SH_GOT20
|| fixP->fx_r_type == BFD_RELOC_SH_GOTPC
|| fixP->fx_r_type == BFD_RELOC_SH_GOTFUNCDESC
|| fixP->fx_r_type == BFD_RELOC_SH_GOTFUNCDESC20
|| fixP->fx_r_type == BFD_RELOC_SH_GOTOFFFUNCDESC
|| fixP->fx_r_type == BFD_RELOC_SH_GOTOFFFUNCDESC20
|| fixP->fx_r_type == BFD_RELOC_SH_FUNCDESC
|| ((fixP->fx_r_type == BFD_RELOC_32) && dont_adjust_reloc_32)
|| fixP->fx_r_type == BFD_RELOC_RVA)
return 0;
@ -3843,6 +3901,22 @@ sh_elf_final_processing (void)
elf_elfheader (stdoutput)->e_flags &= ~EF_SH_MACH_MASK;
elf_elfheader (stdoutput)->e_flags |= val;
if (sh_fdpic)
elf_elfheader (stdoutput)->e_flags |= EF_SH_FDPIC;
}
#endif
#ifdef TE_UCLINUX
/* Return the target format for uClinux. */
const char *
sh_uclinux_target_format (void)
{
if (sh_fdpic)
return (!target_big_endian ? "elf32-sh-fdpic" : "elf32-shbig-fdpic");
else
return (!target_big_endian ? "elf32-shl" : "elf32-sh");
}
#endif
@ -4151,7 +4225,13 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
S_SET_THREAD_LOCAL (fixP->fx_addsy);
/* Fallthrough */
case BFD_RELOC_32_GOT_PCREL:
case BFD_RELOC_SH_GOT20:
case BFD_RELOC_SH_GOTPLT32:
case BFD_RELOC_SH_GOTFUNCDESC:
case BFD_RELOC_SH_GOTFUNCDESC20:
case BFD_RELOC_SH_GOTOFFFUNCDESC:
case BFD_RELOC_SH_GOTOFFFUNCDESC20:
case BFD_RELOC_SH_FUNCDESC:
* valP = 0; /* Fully resolved at runtime. No addend. */
apply_full_field_fix (fixP, buf, 0, 4);
break;
@ -4161,6 +4241,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
S_SET_THREAD_LOCAL (fixP->fx_addsy);
/* Fallthrough */
case BFD_RELOC_32_GOTOFF:
case BFD_RELOC_SH_GOTOFF20:
apply_full_field_fix (fixP, buf, val, 4);
break;
#endif
@ -4468,6 +4549,14 @@ sh_parse_name (char const *name,
reloc_type = BFD_RELOC_SH_TLS_LE_32;
else if ((next_end = sh_end_of_match (next + 1, "DTPOFF")))
reloc_type = BFD_RELOC_SH_TLS_LDO_32;
else if ((next_end = sh_end_of_match (next + 1, "PCREL")))
reloc_type = BFD_RELOC_32_PCREL;
else if ((next_end = sh_end_of_match (next + 1, "GOTFUNCDESC")))
reloc_type = BFD_RELOC_SH_GOTFUNCDESC;
else if ((next_end = sh_end_of_match (next + 1, "GOTOFFFUNCDESC")))
reloc_type = BFD_RELOC_SH_GOTOFFFUNCDESC;
else if ((next_end = sh_end_of_match (next + 1, "FUNCDESC")))
reloc_type = BFD_RELOC_SH_FUNCDESC;
else
goto no_suffix;

View File

@ -1,6 +1,6 @@
/* This file is tc-sh.h
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
2003, 2004, 2005, 2006, 2007, 2008, 2010 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@ -134,7 +134,7 @@ extern void sh_frob_file (void);
#define COFF_MAGIC (!target_big_endian ? SH_ARCH_MAGIC_LITTLE : SH_ARCH_MAGIC_BIG)
#define tc_coff_symbol_emit_hook(a) ; /* not used */
#define tc_coff_symbol_emit_hook(a) ; /* Not used. */
#define TC_KEEP_FX_OFFSET 1
@ -155,7 +155,7 @@ extern void sh_frob_file (void);
#ifdef OBJ_ELF
/* ELF specific definitions. */
/* Whether or not the target is big endian */
/* Whether or not the target is big endian. */
extern int target_big_endian;
#ifdef TE_LINUX
#define TARGET_FORMAT (!target_big_endian ? "elf32-sh-linux" : "elf32-shbig-linux")
@ -165,6 +165,9 @@ extern int target_big_endian;
#define TARGET_FORMAT (!target_big_endian ? "elf32-shl-symbian" : "elf32-sh-symbian")
#elif defined (TE_VXWORKS)
#define TARGET_FORMAT (!target_big_endian ? "elf32-shl-vxworks" : "elf32-sh-vxworks")
#elif defined (TE_UCLINUX)
#define TARGET_FORMAT sh_uclinux_target_format ()
extern const char * sh_uclinux_target_format (void);
#else
#define TARGET_FORMAT (!target_big_endian ? "elf32-shl" : "elf32-sh")
#endif
@ -172,7 +175,7 @@ extern int target_big_endian;
#define elf_tc_final_processing sh_elf_final_processing
extern void sh_elf_final_processing (void);
#define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs */
#define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs. */
#define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_"
@ -227,8 +230,8 @@ extern bfd_boolean sh_fix_adjustable (struct fix *);
#define md_parse_name(name, exprP, mode, nextcharP) \
sh_parse_name ((name), (exprP), (mode), (nextcharP))
int sh_parse_name (char const *name, expressionS *exprP,
enum expr_mode mode, char *nextchar);
int sh_parse_name (char const *, expressionS *,
enum expr_mode, char *);
#define TC_CONS_FIX_NEW(FRAG, OFF, LEN, EXP) \
sh_cons_fix_new ((FRAG), (OFF), (LEN), (EXP))
@ -244,7 +247,7 @@ void sh_cons_fix_new (fragS *, int, int, expressionS *);
extern void sh_cfi_frame_initial_instructions (void);
#define tc_regname_to_dw2regnum sh_regname_to_dw2regnum
extern int sh_regname_to_dw2regnum (char *regname);
extern int sh_regname_to_dw2regnum (char *);
/* All SH instructions are multiples of 16 bits. */
#define DWARF2_LINE_MIN_INSN_LENGTH 2

View File

@ -360,7 +360,8 @@ case ${generic_target} in
*) endian=big ;;
esac ;;
sh*-*-symbianelf*) fmt=elf endian=little ;;
sh-*-elf* | sh-*-uclinux* | sh[12]-*-uclinux*) fmt=elf ;;
sh-*-elf*) fmt=elf ;;
sh-*-uclinux* | sh[12]-*-uclinux*) fmt=elf em=uclinux ;;
sh-*-coff*) fmt=coff ;;
sh-*-nto*) fmt=elf ;;
sh-*-pe*) fmt=coff em=pe bfd_gas=yes endian=little ;;

View File

@ -1,5 +1,5 @@
@c Copyright 1991, 1992, 1993, 1994, 1995, 1997, 2001, 2003, 2004, 2005, 2008
@c Free Software Foundation, Inc.
@c Copyright 1991, 1992, 1993, 1994, 1995, 1997, 2001, 2003, 2004,
@c 2005, 2008, 2010 Free Software Foundation, Inc.
@c This is part of the GAS manual.
@c For copying conditions, see the file as.texinfo.
@page
@ -54,6 +54,10 @@ Renesas assembler.
@item --allow-reg-prefix
Allow '$' as a register name prefix.
@kindex --fdpic
@item --fdpic
Generate an FDPIC object file.
@item --isa=sh4 | sh4a
Specify the sh4 or sh4a instruction set.
@item --isa=dsp

View File

@ -1,3 +1,15 @@
2010-05-25 Daniel Jacobowitz <dan@codesourcery.com>
Joseph Myers <joseph@codesourcery.com>
Andrew Stubbs <ams@codesourcery.com>
* gas/sh/basic.exp: Run new tests. Handle uClinux like Linux.
* gas/sh/fdpic.d: New file.
* gas/sh/fdpic.s: New file.
* gas/sh/reg-prefix.d: Force big-endian.
* gas/sh/sh2a-pic.d: New file.
* gas/sh/sh2a-pic.s: New file.
* lib/gas-defs.exp (is_elf_format): Include sh*-*-uclinux*.
2010-05-18 H.J. Lu <hongjiu.lu@intel.com>
PR gas/11600

View File

@ -142,7 +142,7 @@ if [istarget sh*-*-*] then {
run_dump_test "pcrel2"
}
if {[istarget sh*-*elf] || [istarget sh*-linux*]} then {
if {[istarget sh*-*elf] || [istarget sh*-*linux*]} then {
if {![istarget "sh64*-*-*"] && ![istarget "sh5*-*-*"]} then {
run_dump_test "sh4a"
run_dump_test "sh4a-fp"
@ -151,9 +151,11 @@ if [istarget sh*-*-*] then {
run_dump_test "sh4al-dsp"
run_dump_test "sh2a"
run_dump_test "sh2a-pic"
}
run_dump_test "pic"
run_dump_test "fdpic"
# Test TLS.
run_dump_test "tlsd"

View File

@ -0,0 +1,13 @@
#objdump: -dr --prefix-addresses --show-raw-insn
#name: FDPIC relocations
dump.o: file format elf32-sh.*
Disassembly of section .text:
\.\.\.
0: R_SH_REL32 foo
4: R_SH_FUNCDESC foo
8: R_SH_GOT32 foo
c: R_SH_GOTOFF foo
10: R_SH_GOTFUNCDESC foo
14: R_SH_GOTOFFFUNCDESC foo

View File

@ -0,0 +1,8 @@
.text
.long foo@PCREL
.long foo@FUNCDESC
.long foo@GOT
.long foo@GOTOFF
.long foo@GOTFUNCDESC
.long foo@GOTOFFFUNCDESC

View File

@ -1,10 +1,11 @@
#objdump: -dr --prefix-addresses --show-raw-insn
#as: --allow-reg-prefix -little
#as: --allow-reg-prefix -big
#name: SH --allow-reg-prefix option
#skip: sh*-*-symbian*
# Test SH register names prefixed with $:
.*: file format elf.*sh.*
Disassembly of section .text:
0x00000000 12 60 mov\.l @r1,r0
0x00000000 60 12 mov\.l @r1,r0

View File

@ -0,0 +1,16 @@
#objdump: -dr --prefix-addresses --show-raw-insn
#name: SH2a PIC relocations
#as: -isa=sh2a
#skip: sh*-*-symbian*
dump.o: file format elf32-sh.*
Disassembly of section .text:
0x00000000 01 00 00 00 movi20 #0,r1
0: R_SH_GOT20 foo
0x00000004 01 00 00 00 movi20 #0,r1
4: R_SH_GOTOFF20 foo
0x00000008 01 00 00 00 movi20 #0,r1
8: R_SH_GOTFUNCDESC20 foo
0x0000000c 01 00 00 00 movi20 #0,r1
c: R_SH_GOTOFFFUNCDESC20 foo

View File

@ -0,0 +1,6 @@
.text
movi20 #foo@GOT, r1
movi20 #foo@GOTOFF, r1
movi20 #foo@GOTFUNCDESC, r1
movi20 #foo@GOTOFFFUNCDESC, r1

View File

@ -289,6 +289,7 @@ proc is_elf_format {} {
&& ![istarget hppa*64*-*-hpux*] \
&& ![istarget *-*-linux*] \
&& ![istarget frv-*-uclinux*] \
&& ![istarget sh*-*-uclinux*] \
&& ![istarget *-*-irix5*] \
&& ![istarget *-*-irix6*] \
&& ![istarget *-*-netbsd*] \

View File

@ -1,3 +1,14 @@
2010-05-25 Daniel Jacobowitz <dan@codesourcery.com>
Joseph Myers <joseph@codesourcery.com>
Andrew Stubbs <ams@codesourcery.com>
* sh.h (EF_SH_PIC, EF_SH_FDPIC): Define.
(R_SH_FIRST_INVALID_RELOC_6, R_SH_LAST_INVALID_RELOC_6): New. Adjust
other invalid ranges.
(R_SH_GOT20, R_SH_GOTOFF20, R_SH_GOTFUNCDESC, R_SH_GOTFUNCDESC20)
(R_SH_GOTOFFFUNCDESC, R_SH_GOTOFFFUNCDESC20, R_SH_FUNCDESC)
(R_SH_FUNCDESC_VALUE): New.
2010-05-18 H.J. Lu <hongjiu.lu@intel.com>
PR gas/11600

View File

@ -86,6 +86,12 @@ int sh_find_elf_flags (unsigned int arch_set);
/* Convert bfd_mach_* into EF_SH*. */
int sh_elf_get_flags_from_mach (unsigned long mach);
/* Other e_flags bits. */
#define EF_SH_PIC 0x100 /* Segments of an FDPIC binary may
be relocated independently. */
#define EF_SH_FDPIC 0x8000 /* Uses the FDPIC ABI. */
/* Flags for the st_other symbol field.
Keep away from the STV_ visibility flags (bit 0..1). */
@ -214,7 +220,17 @@ START_RELOC_NUMBERS (elf_sh_reloc_type)
RELOC_NUMBER (R_SH_JMP_SLOT64, 195)
RELOC_NUMBER (R_SH_RELATIVE64, 196)
FAKE_RELOC (R_SH_FIRST_INVALID_RELOC_5, 197)
FAKE_RELOC (R_SH_LAST_INVALID_RELOC_5, 241)
FAKE_RELOC (R_SH_LAST_INVALID_RELOC_5, 200)
RELOC_NUMBER (R_SH_GOT20, 201)
RELOC_NUMBER (R_SH_GOTOFF20, 202)
RELOC_NUMBER (R_SH_GOTFUNCDESC, 203)
RELOC_NUMBER (R_SH_GOTFUNCDESC20, 204)
RELOC_NUMBER (R_SH_GOTOFFFUNCDESC, 205)
RELOC_NUMBER (R_SH_GOTOFFFUNCDESC20, 206)
RELOC_NUMBER (R_SH_FUNCDESC, 207)
RELOC_NUMBER (R_SH_FUNCDESC_VALUE, 208)
FAKE_RELOC (R_SH_FIRST_INVALID_RELOC_6, 209)
FAKE_RELOC (R_SH_LAST_INVALID_RELOC_6, 241)
RELOC_NUMBER (R_SH_SHMEDIA_CODE, 242)
RELOC_NUMBER (R_SH_PT_16, 243)
RELOC_NUMBER (R_SH_IMMS16, 244)

View File

@ -1,3 +1,16 @@
2010-05-25 Daniel Jacobowitz <dan@codesourcery.com>
Joseph Myers <joseph@codesourcery.com>
Andrew Stubbs <ams@codesourcery.com>
* Makefile.am (ALL_EMULATIONS): Add eshelf_fd.o and eshlelf_fd.o.
(eshelf_fd.c, eshlelf_fd.c): New rules.
* Makefile.in: Regenerate.
* configure.tgt (sh-*-uclinux*): Add shelf_fd and shlelf_fd
emulations.
* emulparams/shelf_fd.sh: New file.
* emulparams/shlelf_fd.sh: New file.
* emulparams/shlelf_linux.sh: Update comment.
2010-05-25 Jay Krell <jay.krell@cornell.edu>
PR ld/11621

View File

@ -550,7 +550,7 @@ sh-*-elf* | sh[1234]*-*-elf | sh-*-rtems* | sh-*-kaos*)
targ_extra_emuls="shlelf sh shl" ;;
sh-*-uclinux* | sh[12]-*-uclinux*)
targ_emul=shelf_uclinux
targ_extra_emuls="shelf shlelf sh shl" ;;
targ_extra_emuls="shelf shlelf sh shl shelf_fd shlelf_fd" ;;
sh-*-vxworks) targ_emul=shelf_vxworks
targ_extra_emuls=shlelf_vxworks ;;
sh-*-nto*) targ_emul=shelf_nto

View File

@ -0,0 +1,2 @@
. ${srcdir}/emulparams/shlelf_fd.sh
OUTPUT_FORMAT="elf32-shbig-fdpic"

View File

@ -0,0 +1,16 @@
# If you change this file, please also look at files which source this one:
# shelf_fd.sh
. ${srcdir}/emulparams/shlelf_linux.sh
OUTPUT_FORMAT="elf32-sh-fdpic"
GOT=".got ${RELOCATING-0} : { *(.got.funcdesc) *(.got.plt) *(.got) }"
OTHER_GOT_RELOC_SECTIONS="
.rela.got.funcdesc ${RELOCATING-0} : { *(.rela.got.funcdesc) }
"
OTHER_READONLY_SECTIONS="
.rofixup : {
${RELOCATING+__ROFIXUP_LIST__ = .;}
*(.rofixup)
${RELOCATING+__ROFIXUP_END__ = .;}
}
"

View File

@ -1,5 +1,5 @@
# If you change this file, please also look at files which source this one:
# shelf_linux.sh
# shelf_linux.sh shelf_fd.sh shlelf_fd.sh
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-sh-linux"

View File

@ -1,3 +1,46 @@
2010-05-25 Daniel Jacobowitz <dan@codesourcery.com>
Joseph Myers <joseph@codesourcery.com>
Andrew Stubbs <ams@codesourcery.com>
* ld-sh/sh.exp: Handle uClinux like Linux.
* lib/ld-lib.exp (is_elf_format): Include sh*-*-uclinux*.
* ld-sh/fdpic-funcdesc-shared.d: New file.
* ld-sh/fdpic-funcdesc-shared.s: New file.
* ld-sh/fdpic-funcdesc-static.d: New file.
* ld-sh/fdpic-funcdesc-static.s: New file.
* ld-sh/fdpic-gotfuncdesc-shared.d: New file.
* ld-sh/fdpic-gotfuncdesc-shared.s: New file.
* ld-sh/fdpic-gotfuncdesc-static.d: New file.
* ld-sh/fdpic-gotfuncdesc-static.s: New file.
* ld-sh/fdpic-gotfuncdesci20-shared.d: New file.
* ld-sh/fdpic-gotfuncdesci20-shared.s: New file.
* ld-sh/fdpic-gotfuncdesci20-static.d: New file.
* ld-sh/fdpic-gotfuncdesci20-static.s: New file.
* ld-sh/fdpic-goti20-shared.d: New file.
* ld-sh/fdpic-goti20-shared.s: New file.
* ld-sh/fdpic-goti20-static.d: New file.
* ld-sh/fdpic-goti20-static.s: New file.
* ld-sh/fdpic-gotofffuncdesc-shared.d: New file.
* ld-sh/fdpic-gotofffuncdesc-shared.s: New file.
* ld-sh/fdpic-gotofffuncdesc-static.d: New file.
* ld-sh/fdpic-gotofffuncdesc-static.s: New file.
* ld-sh/fdpic-gotofffuncdesci20-shared.d: New file.
* ld-sh/fdpic-gotofffuncdesci20-shared.s: New file.
* ld-sh/fdpic-gotofffuncdesci20-static.d: New file.
* ld-sh/fdpic-gotofffuncdesci20-static.s: New file.
* ld-sh/fdpic-gotoffi20-shared.d: New file.
* ld-sh/fdpic-gotoffi20-shared.s: New file.
* ld-sh/fdpic-gotoffi20-static.d: New file.
* ld-sh/fdpic-gotoffi20-static.s: New file.
* ld-sh/fdpic-plt-be.d: New file.
* ld-sh/fdpic-plt-le.d: New file.
* ld-sh/fdpic-plt.s: New file.
* ld-sh/fdpic-plti20-be.d: New file.
* ld-sh/fdpic-plti20-le.d: New file.
* ld-sh/fdpic-stack-default.d: New file.
* ld-sh/fdpic-stack-size.d: New file.
* ld-sh/fdpic-stack.s: New file.
2010-05-18 H.J. Lu <hongjiu.lu@intel.com>
PR gas/11600

View File

@ -0,0 +1,32 @@
#source: fdpic-funcdesc-shared.s
#as: --isa=sh2a -big --fdpic
#ld: -EB -mshelf_fd -shared
#objdump: -dsR -j.text -j.data -j.got
#target: sh*-*-uclinux*
.*:[ \t]+file format elf32-shbig-fdpic
Contents of section \.text:
[0-9a-f]+ 0009[ \t]+.*
Contents of section \.data:
[0-9a-f]+ 00000000[ \t]+.*
Contents of section \.got:
[0-9a-f]+ 00000000 00000000 00000000 00000000[ \t]+.*
[0-9a-f]+ 00000000[ \t]+.*
Disassembly of section \.text:
[0-9a-f]+ <foo>:
[0-9a-f]+:[ \t]+00 09[ \t]+nop[ \t]+
Disassembly of section \.data:
[0-9a-f]+ <bar>:
[ \t]+[0-9a-f]+:[ \t]+00 00 00 00[ \t]+\.\.\.\.
[ \t]+[0-9a-f]+: R_SH_DIR32[ \t]+\.got
Disassembly of section \.got:
[0-9a-f]+ <\.got>:
[ \t]+\.\.\.
[ \t]+[0-9a-f]+: R_SH_FUNCDESC_VALUE[ \t]+\.text

View File

@ -0,0 +1,10 @@
.data
.globl bar
.type bar,@object
.size bar,4
bar:
.long foo@FUNCDESC
.text
.type foo,@function
foo:
nop

View File

@ -0,0 +1,25 @@
#source: fdpic-funcdesc-static.s
#as: --isa=sh2a -big --fdpic
#ld: -EB -mshelf_fd
#objdump: -ds
#target: sh*-*-uclinux*
.*:[ \t]+file format elf32-shbig-fdpic
Contents of section \.text:
400094 00090009[ \t]+.*
Contents of section \.rofixup:
400098 004100ac 004100b0 004100a8 004100b4[ \t]+.*
Contents of section \.data:
4100a8 004100ac[ \t]+.*
Contents of section \.got:
4100ac 00400094 004100b4 00000000 00000000[ \t]+.*
4100bc 00000000[ \t]+.*
Disassembly of section \.text:
00400094 <foo>:
[ \t]+400094:[ \t]+00 09[ \t]+nop[ \t]+
00400096 <_start>:
[ \t]+400096:[ \t]+00 09[ \t]+nop[ \t]+

View File

@ -0,0 +1,14 @@
.data
.globl bar
.type bar,@object
.size bar,4
bar:
.long foo@FUNCDESC
.text
.type foo,@function
foo:
nop
.globl _start
.type _start,@function
_start:
nop

View File

@ -0,0 +1,25 @@
#source: fdpic-gotfuncdesc-shared.s
#as: --isa=sh2a -big --fdpic
#ld: -EB -mshelf_fd -shared
#objdump: -dsR -j.text -j.got
#target: sh*-*-uclinux*
.*:[ \t]+file format elf32-shbig-fdpic
Contents of section \.text:
[0-9a-f]+ d00001ce 0000000c[ \t]+.*
Contents of section \.got:
[0-9a-f]+ 00000000 00000000 00000000 00000000[ \t]+.*
Disassembly of section \.text:
[0-9a-f]+ <f>:
[0-9a-f]+:[ \t]+d0 00[ \t]+mov\.l[ \t]+[0-9a-f]+ <f\+0x4>,r0[ \t]+! c
[0-9a-f]+:[ \t]+01 ce[ \t]+mov\.l[ \t]+@\(r0,r12\),r1
[0-9a-f]+:[ \t]+00 00 00 0c[ \t]+movi20[ \t]+#12,r0
Disassembly of section \.got:
[0-9a-f]+ <\.got>:
[ \t]+\.\.\.
[ \t]+[0-9a-f]+: R_SH_FUNCDESC[ \t]+foo

View File

@ -0,0 +1,9 @@
.text
.globl f
.type f,@function
f:
mov.l .L1, r0
mov.l @(r0,r12), r1
.align 2
.L1:
.long foo@GOTFUNCDESC

View File

@ -0,0 +1,26 @@
#source: fdpic-gotfuncdesc-static.s
#as: --isa=sh2a -big --fdpic
#ld: -EB -mshelf_fd
#objdump: -ds
#target: sh*-*-uclinux*
.*:[ \t]+file format elf32-shbig-fdpic
Contents of section \.text:
400094 d00001ce 0000000c 00090009[ \t]+.*
Contents of section \.rofixup:
4000a0 004100b0 004100b4 004100c4 004100b8[ \t]+.*
Contents of section \.got:
4100b0 0040009c 004100b8 00000000 00000000[ \t]+.*
4100c0 00000000 004100b0[ \t]+.*
Disassembly of section \.text:
00400094 <_start>:
[ \t]+400094:[ \t]+d0 00[ \t]+mov\.l[ \t]+400098 <_start\+0x4>,r0[ \t]+! c
[ \t]+400096:[ \t]+01 ce[ \t]+mov\.l[ \t]+@\(r0,r12\),r1
[ \t]+400098:[ \t]+00 00 00 0c[ \t]+movi20[ \t]+#12,r0
0040009c <foo>:
[ \t]+40009c:[ \t]+00 09[ \t]+nop[ \t]+
[ \t]+40009e:[ \t]+00 09[ \t]+nop[ \t]+

View File

@ -0,0 +1,12 @@
.text
.globl _start
.type _start,@function
_start:
mov.l .L1, r0
mov.l @(r0,r12), r1
.align 2
.L1:
.long foo@GOTFUNCDESC
.type foo,@function
foo:
nop

View File

@ -0,0 +1,24 @@
#source: fdpic-gotfuncdesci20-shared.s
#as: --isa=sh2a -big --fdpic
#ld: -EB -mshelf_fd -shared
#objdump: -dsR -j.text -j.got
#target: sh*-*-uclinux*
.*:[ \t]+file format elf32-shbig-fdpic
Contents of section \.text:
[0-9a-f]+ 0000000c 01ce[ \t]+.*
Contents of section \.got:
[0-9a-f]+ 00000000 00000000 00000000 00000000[ \t]+.*
Disassembly of section \.text:
[0-9a-f]+ <f>:
[0-9a-f]+:[ \t]+00 00 00 0c[ \t]+movi20[ \t]+#12,r0
[0-9a-f]+:[ \t]+01 ce[ \t]+mov\.l[ \t]+@\(r0,r12\),r1
Disassembly of section \.got:
[0-9a-f]+ <\.got>:
[ \t]+\.\.\.
[ \t]+[0-9a-f]+: R_SH_FUNCDESC[ \t]+foo

View File

@ -0,0 +1,6 @@
.text
.globl f
.type f,@function
f:
movi20 #foo@GOTFUNCDESC, r0
mov.l @(r0,r12), r1

View File

@ -0,0 +1,24 @@
#source: fdpic-gotfuncdesci20-static.s
#as: --isa=sh2a -big --fdpic
#ld: -EB -mshelf_fd
#objdump: -ds
#target: sh*-*-uclinux*
.*:[ \t]+file format elf32-shbig-fdpic
Contents of section \.text:
400094 0000000c 01ce0009[ \t]+.*
Contents of section \.rofixup:
40009c 004100ac 004100b0 004100c0 004100b4[ \t]+.*
Contents of section \.got:
4100ac 0040009a 004100b4 00000000 00000000[ \t]+.*
4100bc 00000000 004100ac[ \t]+.*
Disassembly of section \.text:
00400094 <_start>:
[ \t]+400094:[ \t]+00 00 00 0c[ \t]+movi20[ \t]+#12,r0
[ \t]+400098:[ \t]+01 ce[ \t]+mov\.l[ \t]+@\(r0,r12\),r1
0040009a <foo>:
[ \t]+40009a:[ \t]+00 09[ \t]+nop[ \t]+

View File

@ -0,0 +1,9 @@
.text
.globl _start
.type _start,@function
_start:
movi20 #foo@GOTFUNCDESC, r0
mov.l @(r0,r12), r1
.type foo,@function
foo:
nop

View File

@ -0,0 +1,24 @@
#source: fdpic-goti20-shared.s
#as: --isa=sh2a -big --fdpic
#ld: -EB -mshelf_fd -shared
#objdump: -dsR -j.text -j.got
#target: sh*-*-uclinux*
.*:[ \t]+file format elf32-shbig-fdpic
Contents of section \.text:
[0-9a-f]+ 0000000c 01ce[ \t]+.*
Contents of section \.got:
[0-9a-f]+ 00000000 00000000 00000000 00000000[ \t]+.*
Disassembly of section \.text:
[0-9a-f]+ <f>:
[0-9a-f]+:[ \t]+00 00 00 0c[ \t]+movi20[ \t]+#12,r0
[0-9a-f]+:[ \t]+01 ce[ \t]+mov\.l[ \t]+@\(r0,r12\),r1
Disassembly of section \.got:
[0-9a-f]+ <\.got>:
[ \t]+\.\.\.
[ \t]+[0-9a-f]+: R_SH_GLOB_DAT[ \t]+foo

View File

@ -0,0 +1,6 @@
.text
.globl f
.type f,@function
f:
movi20 #foo@GOT, r0
mov.l @(r0,r12), r1

View File

@ -0,0 +1,22 @@
#source: fdpic-goti20-static.s
#as: --isa=sh2a -big --fdpic
#ld: -EB -mshelf_fd
#objdump: -ds
#target: sh*-*-uclinux*
.*:[ \t]+file format elf32-shbig-fdpic
Contents of section \.text:
400094 0000000c 01ce[ \t]+.*
Contents of section \.rofixup:
40009c 004100b4 004100a8[ \t]+.*
Contents of section \.data:
4100a4 00000001[ \t]+.*
Contents of section \.got:
4100a8 00000000 00000000 00000000 004100a4[ \t]+.*
Disassembly of section \.text:
00400094 <_start>:
[ \t]+400094:[ \t]+00 00 00 0c[ \t]+movi20[ \t]+#12,r0
[ \t]+400098:[ \t]+01 ce[ \t]+mov\.l[ \t]+@\(r0,r12\),r1

View File

@ -0,0 +1,11 @@
.text
.globl _start
.type _start,@function
_start:
movi20 #foo@GOT, r0
mov.l @(r0,r12), r1
.data
.type foo,@object
.size foo,4
foo:
.long 1

View File

@ -0,0 +1,32 @@
#source: fdpic-gotofffuncdesc-shared.s
#as: --isa=sh2a -big --fdpic
#ld: -EB -mshelf_fd -shared
#objdump: -dsR -j.text -j.got
#target: sh*-*-uclinux*
.*:[ \t]+file format elf32-shbig-fdpic
Contents of section \.text:
[0-9a-f]+ d10031cc fffffff8 00090009[ \t]+.*
Contents of section \.got:
[0-9a-f]+ 00000008 00000000 00000000 00000000[ \t]+.*
[0-9a-f]+ 00000000[ \t]+.*
Disassembly of section \.text:
[0-9a-f]+ <f>:
[0-9a-f]+:[ \t]+d1 00[ \t]+mov\.l[ \t]+[0-9a-f]+ <f\+0x4>,r1[ \t]+! fffffff8
[0-9a-f]+:[ \t]+31 cc[ \t]+add[ \t]+r12,r1
[0-9a-f]+:[ \t]+ff ff[ \t]+\.word 0xffff
[0-9a-f]+:[ \t]+ff f8[ \t]+fmov[ \t]+@r15,fr15
[0-9a-f]+ <foo>:
[0-9a-f]+:[ \t]+00 09[ \t]+nop[ \t]+
[0-9a-f]+:[ \t]+00 09[ \t]+nop[ \t]+
Disassembly of section \.got:
[0-9a-f]+ <\.got>:
[ \t]+[0-9a-f]+:[ \t]+00 00 00 08[ \t]+movi20[ \t]+#8,r0
[ \t]+[0-9a-f]+: R_SH_FUNCDESC_VALUE[ \t]+\.text
[ \t]+\.\.\.

View File

@ -0,0 +1,12 @@
.text
.globl f
.type f,@function
f:
mov.l .L1, r1
add r12, r1
.align 2
.L1:
.long foo@GOTOFFFUNCDESC
.type foo,@function
foo:
nop

View File

@ -0,0 +1,27 @@
#source: fdpic-gotofffuncdesc-static.s
#as: --isa=sh2a -big --fdpic
#ld: -EB -mshelf_fd
#objdump: -ds
#target: sh*-*-uclinux*
.*:[ \t]+file format elf32-shbig-fdpic
Contents of section \.text:
400094 d10031cc fffffff8 00090009[ \t]+.*
Contents of section \.rofixup:
4000a0 004100ac 004100b0 004100b4[ \t]+.*
Contents of section \.got:
4100ac 0040009c 004100b4 00000000 00000000[ \t]+.*
4100bc 00000000[ \t]+.*
Disassembly of section \.text:
00400094 <_start>:
[ \t]+400094:[ \t]+d1 00[ \t]+mov\.l[ \t]+400098 <_start\+0x4>,r1[ \t]+! fffffff8
[ \t]+400096:[ \t]+31 cc[ \t]+add[ \t]+r12,r1
[ \t]+400098:[ \t]+ff ff[ \t]+\.word 0xffff
[ \t]+40009a:[ \t]+ff f8[ \t]+fmov[ \t]+@r15,fr15
0040009c <foo>:
[ \t]+40009c:[ \t]+00 09[ \t]+nop[ \t]+
[ \t]+40009e:[ \t]+00 09[ \t]+nop[ \t]+

View File

@ -0,0 +1,12 @@
.text
.globl _start
.type _start,@function
_start:
mov.l .L1, r1
add r12, r1
.align 2
.L1:
.long foo@GOTOFFFUNCDESC
.type foo,@function
foo:
nop

View File

@ -0,0 +1,29 @@
#source: fdpic-gotofffuncdesci20-shared.s
#as: --isa=sh2a -big --fdpic
#ld: -EB -mshelf_fd -shared
#objdump: -dsR -j.text -j.got
#target: sh*-*-uclinux*
.*:[ \t]+file format elf32-shbig-fdpic
Contents of section \.text:
[0-9a-f]+ 01f0fff8 31cc0009[ \t]+.*
Contents of section \.got:
[0-9a-f]+ 00000006 00000000 00000000 00000000[ \t]+.*
[0-9a-f]+ 00000000[ \t]+.*
Disassembly of section \.text:
[0-9a-f]+ <f>:
[0-9a-f]+:[ \t]+01 f0 ff f8[ \t]+movi20[ \t]+#-8,r1
[0-9a-f]+:[ \t]+31 cc[ \t]+add[ \t]+r12,r1
[0-9a-f]+ <foo>:
[0-9a-f]+:[ \t]+00 09[ \t]+nop[ \t]+
Disassembly of section \.got:
[0-9a-f]+ <\.got>:
[ \t]+[0-9a-f]+:[ \t]+00 00 00 06[ \t]+movi20[ \t]+#6,r0
[ \t]+[0-9a-f]+: R_SH_FUNCDESC_VALUE[ \t]+\.text
[ \t]+\.\.\.

View File

@ -0,0 +1,9 @@
.text
.globl f
.type f,@function
f:
movi20 #foo@GOTOFFFUNCDESC, r1
add r12, r1
.type foo,@function
foo:
nop

View File

@ -0,0 +1,24 @@
#source: fdpic-gotofffuncdesci20-static.s
#as: --isa=sh2a -big --fdpic
#ld: -EB -mshelf_fd
#objdump: -ds
#target: sh*-*-uclinux*
.*:[ \t]+file format elf32-shbig-fdpic
Contents of section \.text:
400094 01f0fff8 31cc0009[ \t]+.*
Contents of section \.rofixup:
40009c 004100a8 004100ac 004100b0[ \t]+.*
Contents of section \.got:
4100a8 0040009a 004100b0 00000000 00000000[ \t]+.*
4100b8 00000000[ \t]+.*
Disassembly of section \.text:
00400094 <_start>:
[ \t]+400094:[ \t]+01 f0 ff f8[ \t]+movi20[ \t]+#-8,r1
[ \t]+400098:[ \t]+31 cc[ \t]+add[ \t]+r12,r1
0040009a <foo>:
[ \t]+40009a:[ \t]+00 09[ \t]+nop[ \t]+

View File

@ -0,0 +1,9 @@
.text
.globl _start
.type _start,@function
_start:
movi20 #foo@GOTOFFFUNCDESC, r1
add r12, r1
.type foo,@function
foo:
nop

View File

@ -0,0 +1,30 @@
#source: fdpic-gotoffi20-shared.s
#as: --isa=sh2a -big --fdpic
#ld: -EB -mshelf_fd -shared
#objdump: -dsR -j.text -j.data -j.got
#target: sh*-*-uclinux*
.*:[ \t]+file format elf32-shbig-fdpic
Contents of section \.text:
[0-9a-f]+ 00f0fffc 01ce[ \t]+.*
Contents of section \.data:
[0-9a-f]+ 00000001[ \t]+.*
Contents of section \.got:
[0-9a-f]+ 00000000 00000000 00000000[ \t]+.*
Disassembly of section \.text:
[0-9a-f]+ <f>:
[0-9a-f]+:[ \t]+00 f0 ff fc[ \t]+movi20[ \t]+#-4,r0
[0-9a-f]+:[ \t]+01 ce[ \t]+mov\.l[ \t]+@\(r0,r12\),r1
Disassembly of section \.data:
[0-9a-f]+ <foo>:
[ \t]+[0-9a-f]+:[ \t]+00 00 00 01[ \t]+\.\.\.\.
Disassembly of section \.got:
[0-9a-f]+ <\.got>:
[ \t]+\.\.\.

View File

@ -0,0 +1,11 @@
.text
.globl f
.type f,@function
f:
movi20 #foo@GOTOFF, r0
mov.l @(r0,r12), r1
.data
.type foo,@object
.size foo,4
foo:
.long 1

View File

@ -0,0 +1,22 @@
#source: fdpic-gotoffi20-static.s
#as: --isa=sh2a -big --fdpic
#ld: -EB -mshelf_fd
#objdump: -ds
#target: sh*-*-uclinux*
.*:[ \t]+file format elf32-shbig-fdpic
Contents of section \.text:
400094 00f0fffc 01ce[ \t]+.*
Contents of section \.rofixup:
40009c 004100a4[ \t]+.*
Contents of section \.data:
4100a0 00000001[ \t]+.*
Contents of section \.got:
4100a4 00000000 00000000 00000000[ \t]+.*
Disassembly of section \.text:
00400094 <_start>:
[ \t]+400094:[ \t]+00 f0 ff fc[ \t]+movi20[ \t]+#-4,r0
[ \t]+400098:[ \t]+01 ce[ \t]+mov\.l[ \t]+@\(r0,r12\),r1

View File

@ -0,0 +1,11 @@
.text
.globl _start
.type _start,@function
_start:
movi20 #foo@GOTOFF, r0
mov.l @(r0,r12), r1
.data
.type foo,@object
.size foo,4
foo:
.long 1

View File

@ -0,0 +1,75 @@
#source: fdpic-plt.s
#as: --isa=sh4a -big --fdpic
#ld: -EB -mshelf_fd -shared
#objdump: -dsR -j.plt -j.text -j.got
#target: sh*-*-uclinux*
.*:[ \t]+file format elf32-shbig-fdpic
Contents of section \.plt:
[0-9a-f]+ d00201ce 7004412b 0cce0009 fffffff0[ \t]+.*
[0-9a-f]+ 00000000 60c2402b 53c10009 d00201ce[ \t]+.*
[0-9a-f]+ 7004412b 0cce0009 fffffff8 0000000c[ \t]+.*
[0-9a-f]+ 60c2402b 53c10009[ \t]+.*
Contents of section \.text:
[0-9a-f]+ d000d101 ffffffc4 ffffffdc[ \t]+.*
Contents of section \.got:
[0-9a-f]+ 0000023c 00000000 00000258 00000000[ \t]+.*
[0-9a-f]+ 00000000 00000000 00000000[ \t]+.*
Disassembly of section \.plt:
[0-9a-f]+ <foo@plt>:
[0-9a-f]+:[ \t]+d0 02[ \t]+mov\.l[ \t]+[0-9a-f]+ <foo@plt\+0xc>,r0[ \t]+! fffffff0
[0-9a-f]+:[ \t]+01 ce[ \t]+mov\.l[ \t]+@\(r0,r12\),r1
[0-9a-f]+:[ \t]+70 04[ \t]+add[ \t]+#4,r0
[0-9a-f]+:[ \t]+41 2b[ \t]+jmp[ \t]+@r1
[0-9a-f]+:[ \t]+0c ce[ \t]+mov\.l[ \t]+@\(r0,r12\),r12
[0-9a-f]+:[ \t]+00 09[ \t]+nop[ \t]+
[0-9a-f]+:[ \t]+ff ff[ \t]+\.word 0xffff
[0-9a-f]+:[ \t]+ff f0[ \t]+fadd[ \t]+fr15,fr15
[0-9a-f]+:[ \t]+00 00[ \t]+\.word 0x0000
[0-9a-f]+:[ \t]+00 00[ \t]+\.word 0x0000
[0-9a-f]+:[ \t]+60 c2[ \t]+mov\.l[ \t]+@r12,r0
[0-9a-f]+:[ \t]+40 2b[ \t]+jmp[ \t]+@r0
[0-9a-f]+:[ \t]+53 c1[ \t]+mov\.l[ \t]+@\(4,r12\),r3
[0-9a-f]+:[ \t]+00 09[ \t]+nop[ \t]+
[0-9a-f]+ <bar@plt>:
[0-9a-f]+:[ \t]+d0 02[ \t]+mov\.l[ \t]+[0-9a-f]+ <bar@plt\+0xc>,r0[ \t]+! fffffff8
[0-9a-f]+:[ \t]+01 ce[ \t]+mov\.l[ \t]+@\(r0,r12\),r1
[0-9a-f]+:[ \t]+70 04[ \t]+add[ \t]+#4,r0
[0-9a-f]+:[ \t]+41 2b[ \t]+jmp[ \t]+@r1
[0-9a-f]+:[ \t]+0c ce[ \t]+mov\.l[ \t]+@\(r0,r12\),r12
[0-9a-f]+:[ \t]+00 09[ \t]+nop[ \t]+
[0-9a-f]+:[ \t]+ff ff[ \t]+\.word 0xffff
[0-9a-f]+:[ \t]+ff f8[ \t]+fmov[ \t]+@r15,fr15
[0-9a-f]+:[ \t]+00 00[ \t]+\.word 0x0000
[0-9a-f]+:[ \t]+00 0c[ \t]+mov\.b[ \t]+@\(r0,r0\),r0
[0-9a-f]+:[ \t]+60 c2[ \t]+mov\.l[ \t]+@r12,r0
[0-9a-f]+:[ \t]+40 2b[ \t]+jmp[ \t]+@r0
[0-9a-f]+:[ \t]+53 c1[ \t]+mov\.l[ \t]+@\(4,r12\),r3
[0-9a-f]+:[ \t]+00 09[ \t]+nop[ \t]+
Disassembly of section \.text:
[0-9a-f]+ <f>:
[0-9a-f]+:[ \t]+d0 00[ \t]+mov\.l[ \t]+[0-9a-f]+ <f\+0x4>,r0[ \t]+! ffffffc4
[0-9a-f]+:[ \t]+d1 01[ \t]+mov\.l[ \t]+[0-9a-f]+ <f\+0x8>,r1[ \t]+! ffffffdc
[0-9a-f]+:[ \t]+ff ff[ \t]+\.word 0xffff
[0-9a-f]+:[ \t]+ff c4[ \t]+fcmp/eq[ \t]+fr12,fr15
[0-9a-f]+:[ \t]+ff ff[ \t]+\.word 0xffff
[0-9a-f]+:[ \t]+ff dc[ \t]+fmov[ \t]+fr13,fr15
Disassembly of section \.got:
[0-9a-f]+ <\.got>:
[ \t]+[0-9a-f]+:[ \t]+00 00[ \t]+\.word 0x0000
[ \t]+[0-9a-f]+: R_SH_FUNCDESC_VALUE[ \t]+foo
[ \t]+[0-9a-f]+:[ \t]+02 3c[ \t]+mov.b[ \t]+@\(r0,r3\),r2
[ \t]+[0-9a-f]+:[ \t]+00 00[ \t]+\.word 0x0000
[ \t]+[0-9a-f]+:[ \t]+00 00[ \t]+\.word 0x0000
[ \t]+[0-9a-f]+:[ \t]+00 00[ \t]+\.word 0x0000
[ \t]+[0-9a-f]+: R_SH_FUNCDESC_VALUE[ \t]+bar
[ \t]+[0-9a-f]+:[ \t]+02 58[ \t]+\.word 0x0258
[ \t]+\.\.\.

View File

@ -0,0 +1,74 @@
#source: fdpic-plt.s
#as: --isa=sh4a -little --fdpic
#ld: -EL -mshlelf_fd -shared
#objdump: -dsR -j.plt -j.text -j.got
#target: sh*-*-uclinux*
.*:[ \t]+file format elf32-sh-fdpic
Contents of section \.plt:
[0-9a-f]+ 02d0ce01 04702b41 ce0c0900 f0ffffff[ \t]+.*
[0-9a-f]+ 00000000 c2602b40 c1530900 02d0ce01[ \t]+.*
[0-9a-f]+ 04702b41 ce0c0900 f8ffffff 0c000000[ \t]+.*
[0-9a-f]+ c2602b40 c1530900[ \t]+.*
Contents of section \.text:
[0-9a-f]+ 00d001d1 c4ffffff dcffffff[ \t]+.*
Contents of section \.got:
[0-9a-f]+ 3c020000 00000000 58020000 00000000[ \t]+.*
[0-9a-f]+ 00000000 00000000 00000000[ \t]+.*
Disassembly of section \.plt:
[0-9a-f]+ <foo@plt>:
[0-9a-f]+:[ \t]+02 d0[ \t]+mov\.l[ \t]+[0-9a-f]+ <foo@plt\+0xc>,r0[ \t]+! fffffff0
[0-9a-f]+:[ \t]+ce 01[ \t]+mov\.l[ \t]+@\(r0,r12\),r1
[0-9a-f]+:[ \t]+04 70[ \t]+add[ \t]+#4,r0
[0-9a-f]+:[ \t]+2b 41[ \t]+jmp[ \t]+@r1
[0-9a-f]+:[ \t]+ce 0c[ \t]+mov\.l[ \t]+@\(r0,r12\),r12
[0-9a-f]+:[ \t]+09 00[ \t]+nop[ \t]+
[0-9a-f]+:[ \t]+f0 ff[ \t]+fadd[ \t]+fr15,fr15
[0-9a-f]+:[ \t]+ff ff[ \t]+\.word 0xffff
[0-9a-f]+:[ \t]+00 00[ \t]+\.word 0x0000
[0-9a-f]+:[ \t]+00 00[ \t]+\.word 0x0000
[0-9a-f]+:[ \t]+c2 60[ \t]+mov\.l[ \t]+@r12,r0
[0-9a-f]+:[ \t]+2b 40[ \t]+jmp[ \t]+@r0
[0-9a-f]+:[ \t]+c1 53[ \t]+mov\.l[ \t]+@\(4,r12\),r3
[0-9a-f]+:[ \t]+09 00[ \t]+nop[ \t]+
[0-9a-f]+ <bar@plt>:
[0-9a-f]+:[ \t]+02 d0[ \t]+mov\.l[ \t]+[0-9a-f]+ <bar@plt\+0xc>,r0[ \t]+! fffffff8
[0-9a-f]+:[ \t]+ce 01[ \t]+mov\.l[ \t]+@\(r0,r12\),r1
[0-9a-f]+:[ \t]+04 70[ \t]+add[ \t]+#4,r0
[0-9a-f]+:[ \t]+2b 41[ \t]+jmp[ \t]+@r1
[0-9a-f]+:[ \t]+ce 0c[ \t]+mov\.l[ \t]+@\(r0,r12\),r12
[0-9a-f]+:[ \t]+09 00[ \t]+nop[ \t]+
[0-9a-f]+:[ \t]+f8 ff[ \t]+fmov[ \t]+@r15,fr15
[0-9a-f]+:[ \t]+ff ff[ \t]+\.word 0xffff
[0-9a-f]+:[ \t]+0c 00[ \t]+mov\.b[ \t]+@\(r0,r0\),r0
[0-9a-f]+:[ \t]+00 00[ \t]+\.word 0x0000
[0-9a-f]+:[ \t]+c2 60[ \t]+mov\.l[ \t]+@r12,r0
[0-9a-f]+:[ \t]+2b 40[ \t]+jmp[ \t]+@r0
[0-9a-f]+:[ \t]+c1 53[ \t]+mov\.l[ \t]+@\(4,r12\),r3
[0-9a-f]+:[ \t]+09 00[ \t]+nop[ \t]+
Disassembly of section \.text:
[0-9a-f]+ <f>:
[0-9a-f]+:[ \t]+00 d0[ \t]+mov\.l[ \t]+[0-9a-f]+ <f\+0x4>,r0[ \t]+! ffffffc4
[0-9a-f]+:[ \t]+01 d1[ \t]+mov\.l[ \t]+[0-9a-f]+ <f\+0x8>,r1[ \t]+! ffffffdc
[0-9a-f]+:[ \t]+c4 ff[ \t]+fcmp/eq[ \t]+fr12,fr15
[0-9a-f]+:[ \t]+ff ff[ \t]+\.word 0xffff
[0-9a-f]+:[ \t]+dc ff[ \t]+fmov[ \t]+fr13,fr15
[0-9a-f]+:[ \t]+ff ff[ \t]+\.word 0xffff
Disassembly of section \.got:
[0-9a-f]+ <\.got>:
[ \t]+[0-9a-f]+:[ \t]+3c 02[ \t]+mov.b[ \t]+@\(r0,r3\),r2
[ \t]+[0-9a-f]+: R_SH_FUNCDESC_VALUE[ \t]+foo
[ \t]+[0-9a-f]+:[ \t]+00 00[ \t]+\.word 0x0000
[ \t]+[0-9a-f]+:[ \t]+00 00[ \t]+\.word 0x0000
[ \t]+[0-9a-f]+:[ \t]+00 00[ \t]+\.word 0x0000
[ \t]+[0-9a-f]+:[ \t]+58 02[ \t]+\.word 0x0258
[ \t]+[0-9a-f]+: R_SH_FUNCDESC_VALUE[ \t]+bar
[ \t]+\.\.\.

View File

@ -0,0 +1,11 @@
.text
.globl f
.type f,@function
f:
mov.l .L1, r0
mov.l .L2, r1
.align 2
.L1:
.long foo@PLT
.L2:
.long bar@PLT

View File

@ -0,0 +1,63 @@
#source: fdpic-plt.s
#as: --isa=sh2a -big --fdpic
#ld: -EB -mshelf_fd -shared
#objdump: -dsR -j.plt -j.text -j.got
#target: sh*-*-uclinux*
.*:[ \t]+file format elf32-shbig-fdpic
Contents of section \.plt:
[0-9a-f]+ 00f0fff0 01ce7004 412b0cce 00000000[ \t]+.*
[0-9a-f]+ 60c2402b 53c10009 00f0fff8 01ce7004[ \t]+.*
[0-9a-f]+ 412b0cce 0000000c 60c2402b 53c10009[ \t]+.*
Contents of section \.text:
[0-9a-f]+ d000d101 ffffffcc ffffffe0[ \t]+.*
Contents of section \.got:
[0-9a-f]+ 00000238 00000000 00000250 00000000[ \t]+.*
[0-9a-f]+ 00000000 00000000 00000000[ \t]+.*
Disassembly of section \.plt:
[0-9a-f]+ <foo@plt>:
[0-9a-f]+:[ \t]+00 f0 ff f0[ \t]+movi20[ \t]+#-16,r0
[0-9a-f]+:[ \t]+01 ce[ \t]+mov\.l[ \t]+@\(r0,r12\),r1
[0-9a-f]+:[ \t]+70 04[ \t]+add[ \t]+#4,r0
[0-9a-f]+:[ \t]+41 2b[ \t]+jmp[ \t]+@r1
[0-9a-f]+:[ \t]+0c ce[ \t]+mov\.l[ \t]+@\(r0,r12\),r12
[0-9a-f]+:[ \t]+00 00 00 00[ \t]+movi20[ \t]+#0,r0
[0-9a-f]+:[ \t]+60 c2[ \t]+mov\.l[ \t]+@r12,r0
[0-9a-f]+:[ \t]+40 2b[ \t]+jmp[ \t]+@r0
[0-9a-f]+:[ \t]+53 c1[ \t]+mov\.l[ \t]+@\(4,r12\),r3
[0-9a-f]+:[ \t]+00 09[ \t]+nop[ \t]+
[0-9a-f]+ <bar@plt>:
[0-9a-f]+:[ \t]+00 f0 ff f8[ \t]+movi20[ \t]+#-8,r0
[0-9a-f]+:[ \t]+01 ce[ \t]+mov\.l[ \t]+@\(r0,r12\),r1
[0-9a-f]+:[ \t]+70 04[ \t]+add[ \t]+#4,r0
[0-9a-f]+:[ \t]+41 2b[ \t]+jmp[ \t]+@r1
[0-9a-f]+:[ \t]+0c ce[ \t]+mov\.l[ \t]+@\(r0,r12\),r12
[0-9a-f]+:[ \t]+00 00 00 0c[ \t]+movi20[ \t]+#12,r0
[0-9a-f]+:[ \t]+60 c2[ \t]+mov\.l[ \t]+@r12,r0
[0-9a-f]+:[ \t]+40 2b[ \t]+jmp[ \t]+@r0
[0-9a-f]+:[ \t]+53 c1[ \t]+mov\.l[ \t]+@\(4,r12\),r3
[0-9a-f]+:[ \t]+00 09[ \t]+nop[ \t]+
Disassembly of section \.text:
[0-9a-f]+ <f>:
[0-9a-f]+:[ \t]+d0 00[ \t]+mov\.l[ \t]+[0-9a-f]+ <f\+0x4>,r0[ \t]+! ffffffcc
[0-9a-f]+:[ \t]+d1 01[ \t]+mov\.l[ \t]+[0-9a-f]+ <f\+0x8>,r1[ \t]+! ffffffe0
[0-9a-f]+:[ \t]+ff ff[ \t]+\.word 0xffff
[0-9a-f]+:[ \t]+ff cc[ \t]+fmov[ \t]+fr12,fr15
[0-9a-f]+:[ \t]+ff ff[ \t]+\.word 0xffff
[0-9a-f]+:[ \t]+ff e0[ \t]+fadd[ \t]+fr14,fr15
Disassembly of section \.got:
[0-9a-f]+ <\.got>:
[ \t]+[0-9a-f]+:[ \t]+00 00 02 38[ \t]+movi20[ \t]+#568,r0
[ \t]+[0-9a-f]+: R_SH_FUNCDESC_VALUE[ \t]+foo
[ \t]+[0-9a-f]+:[ \t]+00 00 00 00[ \t]+movi20[ \t]+#0,r0
[ \t]+[0-9a-f]+:[ \t]+00 00 02 50[ \t]+movi20[ \t]+#592,r0
[ \t]+[0-9a-f]+: R_SH_FUNCDESC_VALUE[ \t]+bar
[ \t]+\.\.\.

View File

@ -0,0 +1,63 @@
#source: fdpic-plt.s
#as: --isa=sh2a -little --fdpic
#ld: -EL -mshlelf_fd -shared
#objdump: -dsR -j.plt -j.text -j.got
#target: sh*-*-uclinux*
.*:[ \t]+file format elf32-sh-fdpic
Contents of section \.plt:
[0-9a-f]+ f000f0ff ce010470 2b41ce0c 00000000[ \t]+.*
[0-9a-f]+ c2602b40 c1530900 f000f8ff ce010470[ \t]+.*
[0-9a-f]+ 2b41ce0c 0c000000 c2602b40 c1530900[ \t]+.*
Contents of section \.text:
[0-9a-f]+ 00d001d1 ccffffff e0ffffff[ \t]+.*
Contents of section \.got:
[0-9a-f]+ 38020000 00000000 50020000 00000000[ \t]+.*
[0-9a-f]+ 00000000 00000000 00000000[ \t]+.*
Disassembly of section \.plt:
[0-9a-f]+ <foo@plt>:
[0-9a-f]+:[ \t]+f0 00 f0 ff[ \t]+movi20[ \t]+#-16,r0
[0-9a-f]+:[ \t]+ce 01[ \t]+mov\.l[ \t]+@\(r0,r12\),r1
[0-9a-f]+:[ \t]+04 70[ \t]+add[ \t]+#4,r0
[0-9a-f]+:[ \t]+2b 41[ \t]+jmp[ \t]+@r1
[0-9a-f]+:[ \t]+ce 0c[ \t]+mov\.l[ \t]+@\(r0,r12\),r12
[0-9a-f]+:[ \t]+00 00 00 00[ \t]+movi20[ \t]+#0,r0
[0-9a-f]+:[ \t]+c2 60[ \t]+mov\.l[ \t]+@r12,r0
[0-9a-f]+:[ \t]+2b 40[ \t]+jmp[ \t]+@r0
[0-9a-f]+:[ \t]+c1 53[ \t]+mov\.l[ \t]+@\(4,r12\),r3
[0-9a-f]+:[ \t]+09 00[ \t]+nop[ \t]+
[0-9a-f]+ <bar@plt>:
[0-9a-f]+:[ \t]+f0 00 f8 ff[ \t]+movi20[ \t]+#-8,r0
[0-9a-f]+:[ \t]+ce 01[ \t]+mov\.l[ \t]+@\(r0,r12\),r1
[0-9a-f]+:[ \t]+04 70[ \t]+add[ \t]+#4,r0
[0-9a-f]+:[ \t]+2b 41[ \t]+jmp[ \t]+@r1
[0-9a-f]+:[ \t]+ce 0c[ \t]+mov\.l[ \t]+@\(r0,r12\),r12
[0-9a-f]+:[ \t]+0c 00[ \t]+mov\.b[ \t]+@\(r0,r0\),r0
[0-9a-f]+:[ \t]+00 00 c2 60[ \t]+movi20[ \t]+#24770,r0
[0-9a-f]+:[ \t]+2b 40[ \t]+jmp[ \t]+@r0
[0-9a-f]+:[ \t]+c1 53[ \t]+mov\.l[ \t]+@\(4,r12\),r3
[0-9a-f]+:[ \t]+09 00[ \t]+nop[ \t]+
Disassembly of section \.text:
[0-9a-f]+ <f>:
[0-9a-f]+:[ \t]+00 d0[ \t]+mov\.l[ \t]+[0-9a-f]+ <f\+0x4>,r0[ \t]+! ffffffcc
[0-9a-f]+:[ \t]+01 d1[ \t]+mov\.l[ \t]+[0-9a-f]+ <f\+0x8>,r1[ \t]+! ffffffe0
[0-9a-f]+:[ \t]+cc ff[ \t]+fmov[ \t]+fr12,fr15
[0-9a-f]+:[ \t]+ff ff[ \t]+\.word 0xffff
[0-9a-f]+:[ \t]+e0 ff[ \t]+fadd[ \t]+fr14,fr15
[0-9a-f]+:[ \t]+ff ff[ \t]+\.word 0xffff
Disassembly of section \.got:
[0-9a-f]+ <\.got>:
[ \t]+[0-9a-f]+:[ \t]+38 02[ \t]+\.word[ \t]+0x0238
[ \t]+[0-9a-f]+: R_SH_FUNCDESC_VALUE[ \t]+foo
[ \t]+[0-9a-f]+:[ \t]+00 00 00 00[ \t]+movi20[ \t]+#0,r0
[ \t]+[0-9a-f]+:[ \t]+00 00 50 02[ \t]+movi20[ \t]+#592,r0
[ \t]+[0-9a-f]+: R_SH_FUNCDESC_VALUE[ \t]+bar
[ \t]+\.\.\.

View File

@ -0,0 +1,19 @@
#source: fdpic-stack.s
#as: --isa=sh2a -big --fdpic
#ld: -EB -mshelf_fd
#readelf: -l
#target: sh*-*-uclinux*
Elf file type is EXEC \(Executable file\)
Entry point 0x400074
There are 2 program headers, starting at offset 52
Program Headers:
[ \t]+Type[ \t]+Offset[ \t]+VirtAddr[ \t]+PhysAddr[ \t]+FileSiz MemSiz[ \t]+Flg Align
[ \t]+LOAD[ \t]+0x000000 0x00400000 0x00400000 0x00076 0x00076 R E 0x10000
[ \t]+GNU_STACK[ \t]+0x000000 0x00000000 0x00000000 0x00000 0x20000 RWE 0x8
Section to Segment mapping:
[ \t]+Segment Sections\.\.\.
[ \t]+00[ \t]+\.text
[ \t]+01[ \t]+

View File

@ -0,0 +1,19 @@
#source: fdpic-stack.s
#as: --isa=sh2a -big --fdpic
#ld: -EB -mshelf_fd --defsym __stacksize=0x40000
#readelf: -l
#target: sh*-*-uclinux*
Elf file type is EXEC \(Executable file\)
Entry point 0x400074
There are 2 program headers, starting at offset 52
Program Headers:
[ \t]+Type[ \t]+Offset[ \t]+VirtAddr[ \t]+PhysAddr[ \t]+FileSiz MemSiz[ \t]+Flg Align
[ \t]+LOAD[ \t]+0x000000 0x00400000 0x00400000 0x00076 0x00076 R E 0x10000
[ \t]+GNU_STACK[ \t]+0x000000 0x00000000 0x00000000 0x00000 0x40000 RWE 0x8
Section to Segment mapping:
[ \t]+Segment Sections\.\.\.
[ \t]+00[ \t]+\.text
[ \t]+01[ \t]+

View File

@ -0,0 +1,5 @@
.text
.globl _start
.type _start,@function
_start:
nop

View File

@ -122,7 +122,7 @@ if { [which $CC] == 0 } {
return
}
if [istarget sh*-linux-*] {
if [istarget sh*-*linux*] {
exec sed -e s/_main/main/ -e s/_trap/trap/ -e s/_stack/stack/ \
< $srcdir/$subdir/start.s >tmpdir/start.s
} else {

View File

@ -404,6 +404,7 @@ proc is_elf_format {} {
&& ![istarget *-*-linux*] \
&& ![istarget frv-*-uclinux*] \
&& ![istarget bfin-*-uclinux] \
&& ![istarget sh*-*-uclinux*] \
&& ![istarget *-*-irix5*] \
&& ![istarget *-*-irix6*] \
&& ![istarget *-*-netbsd*] \