mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-27 03:51:15 +08:00
738e53487d
* reloc.c (BFD_RELOC_MIPS16_GOT16, BFD_RELOC_MIPS16_CALL16): Declare. * libbfd.h, bfd-in2.h: Regenerate. * elf32-mips.c (elf_mips16_howto_table_rel): Fill in reserved R_MIPS16_GOT16 and R_MIPS16_CALL16 entries. (mips16_reloc_map): Add mappings. * elf64-mips.c (mips16_elf64_howto_table_rel): Fill in reserved R_MIPS16_GOT16 and R_MIPS16_CALL16 entries. (mips16_elf64_howto_table_rela): Likewise. (mips16_reloc_map): Add mappings. * elfn32-mips.c (elf_mips16_howto_table_rel): Fill in reserved R_MIPS16_GOT16 and R_MIPS16_CALL16 entries. (elf_mips16_howto_table_rela): Likewise. (mips16_reloc_map): Add mappings. * elfxx-mips.c (mips_elf_create_shadow_symbol): New function. (section_allows_mips16_refs_p): Likewise. (mips16_stub_symndx): Likewise. (mips_elf_check_mips16_stubs): Treat the data argument as a bfd_link_info. Mark every dynamic symbol as needing MIPS16 stubs and create a "shadow" symbol for the original MIPS16 definition. (mips16_reloc_p, got16_reloc_p, call16_reloc_p, hi16_reloc_p) (lo16_reloc_p, mips16_call_reloc_p): New functions. (_bfd_mips16_elf_reloc_unshuffle): Use mips16_reloc_p to generalize relocation checks. (_bfd_mips16_elf_reloc_shuffle): Likewise. (_bfd_mips_elf_lo16_reloc): Handle R_MIPS16_GOT16. (mips_elf_got16_entry): Add comment. (mips_elf_calculate_relocation): Use hi16_reloc_p, lo16_reloc_p, mips16_call_reloc_p, call16_reloc_p and got16_reloc_p to generalize relocation checks. Use section_allows_mips16_refs_p instead of mips16_stub_section_p. Handle R_MIPS16_CALL16 and R_MIPS16_GOT16, allowing the former to refer directly to a MIPS16 function if its stub is not needed. (mips16_stub_section_p): Delete. (_bfd_mips_elf_symbol_processing): Convert odd-valued function symbols into even MIPS16 symbols. (mips_elf_add_lo16_rel_addend): Use mips16_reloc_p to generalize a relocation check. (_bfd_mips_elf_check_relocs): Calculate "bed" and "rel_end" earlier in the function. Use mips16_stub_symndx to identify the target function. Avoid out-of-bounds accesses when the stub has no relocations; report an error instead. Use section_allows_mips16_refs_p instead of mips16_stub_section_p. Use mips16_call_reloc_p and got16_reloc_p to generalize relocation checks. Handle R_MIPS16_CALL16 and R_MIPS16_GOT16. Don't create dynamic relocations for absolute references to __gnu_local_gp. (_bfd_mips_elf_always_size_sections): Pass a bfd_link_info as the argument to mips_elf_check_mips16_stubs. Generalize comment. (_bfd_mips_elf_relocate_section): Use hi16_reloc_p and got16_reloc_p to generalize relocation checks. (_bfd_mips_elf_finish_dynamic_symbol): If a dynamic MIPS16 function symbol has a non-MIPS16 stub, redirect the symbol to the stub. Fix an overly long line. Don't give dynamic symbols type STO_MIPS16. (_bfd_mips_elf_gc_sweep_hook): Handle R_MIPS16_CALL16 and R_MIPS16_GOT16. gas/ * config/tc-mips.c (mips16_reloc_p, got16_reloc_p, hi16_reloc_p) (lo16_reloc_p): New functions. (reloc_needs_lo_p): Use hi16_reloc_p and got16_reloc_p to generalize relocation checks. (matching_lo_reloc): New function. (fixup_has_matching_lo_p): Use it. (mips16_mark_labels): Don't clobber a symbol's visibility. (append_insn): Use hi16_reloc_p and lo16_reloc_p. (mips16_ip): Handle BFD_RELOC_MIPS16_GOT16 and BFD_RELOC_MIPS16_CALL16. (md_apply_fix): Likewise. (mips16_percent_op): Add %got and %call16. (mips_frob_file): Use got16_reloc_p to generalize relocation checks. Use matching_lo_reloc. (mips_force_relocation): Use hi16_reloc_p and lo16_reloc_p to generalize relocation checks. (mips_fix_adjustable): Use lo16_reloc_p to generalize relocation checks. gas/testsuite/ * gas/mips/elf-rel8-mips16.d, gas/mips/elf-rel8-mips16.s, * gas/mips/elf-rel9-mips16.d, gas/mips/elf-rel9-mips16.s, * gas/mips/elf-rel13-mips16.d, gas/mips/elf-rel13-mips16.s: New tests. * gas/mips/mips.exp: Run them. ld/testsuite/ * ld-mips-elf/mips16-local-stubs-1.d: Remove stub_for_h3, which was only referenced by the .pdr section, and was not actually needed by code. * ld-mips-elf/mips16-intermix.d: Remove unused static function stubs. * ld-mips-elf/mips16-pic-1a.s, ld-mips-elf/mips16-pic-1b.s, ld-mips-elf/mips16-pic-1-dummy.s, ld-mips-elf/mips16-pic-1.dd, ld-mips-elf/mips16-pic-1.gd, ld-mips-elf/mips16-pic-1.inc, ld-mips-elf/mips16-pic-1.ld, ld-mips-elf/mips16-pic-2a.s, ld-mips-elf/mips16-pic-2b.s, ld-mips-elf/mips16-pic-2.ad, ld-mips-elf/mips16-pic-2.dd, ld-mips-elf/mips16-pic-2.gd, ld-mips-elf/mips16-pic-2.nd, ld-mips-elf/mips16-pic-2.rd: New tests. * ld-mips-elf/mips-elf.exp: Run them. |
||
---|---|---|
.. | ||
attr-gnu-4-0.s | ||
attr-gnu-4-1.s | ||
attr-gnu-4-2.s | ||
attr-gnu-4-3.s | ||
attr-gnu-4-4.s | ||
attr-gnu-4-5.s | ||
attr-gnu-4-00.d | ||
attr-gnu-4-01.d | ||
attr-gnu-4-02.d | ||
attr-gnu-4-03.d | ||
attr-gnu-4-04.d | ||
attr-gnu-4-05.d | ||
attr-gnu-4-10.d | ||
attr-gnu-4-11.d | ||
attr-gnu-4-12.d | ||
attr-gnu-4-13.d | ||
attr-gnu-4-14.d | ||
attr-gnu-4-15.d | ||
attr-gnu-4-20.d | ||
attr-gnu-4-21.d | ||
attr-gnu-4-22.d | ||
attr-gnu-4-23.d | ||
attr-gnu-4-24.d | ||
attr-gnu-4-25.d | ||
attr-gnu-4-30.d | ||
attr-gnu-4-31.d | ||
attr-gnu-4-32.d | ||
attr-gnu-4-33.d | ||
attr-gnu-4-34.d | ||
attr-gnu-4-35.d | ||
attr-gnu-4-40.d | ||
attr-gnu-4-41.d | ||
attr-gnu-4-42.d | ||
attr-gnu-4-43.d | ||
attr-gnu-4-44.d | ||
attr-gnu-4-45.d | ||
attr-gnu-4-51.d | ||
branch-misc-1.d | ||
dyn-sec64.d | ||
dyn-sec64.ld | ||
dyn-sec64.s | ||
eh-frame1-n32.d | ||
eh-frame1-n64.d | ||
eh-frame1.ld | ||
eh-frame1.s | ||
eh-frame2-n32.d | ||
eh-frame2-n64.d | ||
eh-frame3.d | ||
eh-frame4.d | ||
elf-rel-got-n32.d | ||
elf-rel-got-n64-linux.d | ||
elf-rel-got-n64.d | ||
elf-rel-xgot-n32.d | ||
elf-rel-xgot-n64-linux.d | ||
elf-rel-xgot-n64.d | ||
emit-relocs-1.d | ||
emit-relocs-1.ld | ||
emit-relocs-1a.s | ||
emit-relocs-1b.s | ||
got-dump-1.d | ||
got-dump-1.ld | ||
got-dump-1.s | ||
got-dump-2.d | ||
got-dump-2.ld | ||
got-dump-2.s | ||
got-page-1.d | ||
got-page-1.ld | ||
got-page-1.s | ||
got-page-2.d | ||
got-page-2.s | ||
got-page-3.d | ||
got-page-3a.s | ||
got-page-3b.s | ||
got-page-3c.s | ||
hash1.s | ||
hash1a.d | ||
hash1b.d | ||
hash1c.d | ||
jalbal.d | ||
jalbal.s | ||
jaloverflow-2.d | ||
jaloverflow-2.s | ||
jaloverflow.d | ||
jaloverflow.s | ||
jr.s | ||
mips16-1.d | ||
mips16-1a.s | ||
mips16-1b.s | ||
mips16-call-global-1.s | ||
mips16-call-global-2.s | ||
mips16-call-global-3.s | ||
mips16-call-global.d | ||
mips16-hilo-n32.d | ||
mips16-hilo.d | ||
mips16-hilo.ld | ||
mips16-hilo.s | ||
mips16-intermix-1.s | ||
mips16-intermix-2.s | ||
mips16-intermix.d | ||
mips16-local-stubs-1.d | ||
mips16-local-stubs-1.s | ||
mips16-pic-1-dummy.s | ||
mips16-pic-1.dd | ||
mips16-pic-1.gd | ||
mips16-pic-1.inc | ||
mips16-pic-1.ld | ||
mips16-pic-1a.s | ||
mips16-pic-1b.s | ||
mips16-pic-2.ad | ||
mips16-pic-2.dd | ||
mips16-pic-2.gd | ||
mips16-pic-2.nd | ||
mips16-pic-2.rd | ||
mips16-pic-2a.s | ||
mips16-pic-2b.s | ||
mips-dyn.ld | ||
mips-elf-flags.exp | ||
mips-elf.exp | ||
mips-lib.ld | ||
multi-got-1-1.s | ||
multi-got-1-2.s | ||
multi-got-1.d | ||
multi-got-hidden-1.d | ||
multi-got-hidden-1.s | ||
multi-got-hidden-2.d | ||
multi-got-hidden-2.s | ||
multi-got-no-shared-1.s | ||
multi-got-no-shared-2.s | ||
multi-got-no-shared.d | ||
no-shared-1-n32.d | ||
no-shared-1-n64.d | ||
no-shared-1-n64.s | ||
no-shared-1-o32.d | ||
no-shared-1-o32.s | ||
no-shared-1.ld | ||
region1.d | ||
region1.t | ||
region1a.s | ||
region1b.s | ||
rel32-n32.d | ||
rel32-o32.d | ||
rel32.s | ||
rel64.d | ||
rel64.s | ||
relax-jalr-n32-shared.d | ||
relax-jalr-n32.d | ||
relax-jalr-n64-shared.d | ||
relax-jalr-n64.d | ||
relax-jalr.s | ||
reloc-1-n32.d | ||
reloc-1-n64.d | ||
reloc-1-rel.d | ||
reloc-1a.s | ||
reloc-1b.s | ||
reloc-2.d | ||
reloc-2.ld | ||
reloc-2a.s | ||
reloc-2b.s | ||
reloc-3-n32.d | ||
reloc-3.d | ||
reloc-4.d | ||
reloc-4.s | ||
reloc-5.d | ||
reloc-5.s | ||
reloc-merge-lo16.d | ||
reloc-merge-lo16.ld | ||
reloc-merge-lo16.s | ||
stub-dynsym-1-2fe80.d | ||
stub-dynsym-1-7fff.d | ||
stub-dynsym-1-8000.d | ||
stub-dynsym-1-10000.d | ||
stub-dynsym-1-fff0.d | ||
stub-dynsym-1.ld | ||
stub-dynsym-1.s | ||
textrel-1.d | ||
textrel-1.s | ||
tls-hidden2-got.d | ||
tls-hidden2.d | ||
tls-hidden2a.s | ||
tls-hidden2b.s | ||
tls-hidden3.d | ||
tls-hidden3.got | ||
tls-hidden3.ld | ||
tls-hidden3.r | ||
tls-hidden3a.s | ||
tls-hidden3b.s | ||
tls-hidden4.got | ||
tls-hidden4.r | ||
tls-hidden4a.s | ||
tls-hidden4b.s | ||
tls-multi-got-1-1.s | ||
tls-multi-got-1-2.s | ||
tls-multi-got-1.d | ||
tls-multi-got-1.got | ||
tls-multi-got-1.r | ||
tlsbin-o32.d | ||
tlsbin-o32.got | ||
tlsbin-o32.s | ||
tlsdyn-o32-1.d | ||
tlsdyn-o32-1.got | ||
tlsdyn-o32-2.d | ||
tlsdyn-o32-2.got | ||
tlsdyn-o32-2.s | ||
tlsdyn-o32-3.d | ||
tlsdyn-o32-3.got | ||
tlsdyn-o32.d | ||
tlsdyn-o32.got | ||
tlsdyn-o32.s | ||
tlslib-hidden.ver | ||
tlslib-o32-hidden.got | ||
tlslib-o32-ver.got | ||
tlslib-o32.d | ||
tlslib-o32.got | ||
tlslib-o32.s | ||
tlslib.ver | ||
vxworks1-lib.dd | ||
vxworks1-lib.nd | ||
vxworks1-lib.rd | ||
vxworks1-lib.s | ||
vxworks1-lib.td | ||
vxworks1-static.d | ||
vxworks1.dd | ||
vxworks1.ld | ||
vxworks1.rd | ||
vxworks1.s | ||
vxworks2-static.sd | ||
vxworks2.s | ||
vxworks2.sd | ||
vxworks-forced-local-1.d | ||
vxworks-forced-local-1.s | ||
vxworks-forced-local-1.ver |