old-cross-binutils/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-n64.dd
Maciej W. Rozycki 1bbce13264 bfd/
* elfxx-mips.h (_bfd_mips_elf_get_synthetic_symtab): New
	prototype.
	* elf32-mips.c (elf_backend_plt_sym_val): Remove macro.
	(bfd_elf32_get_synthetic_symtab): New macro.
	* elfxx-mips.c (plt_entry): New structure.
	(mips_elf_link_hash_entry): Add use_plt_entry member.
	(mips_elf_link_hash_table): Rename plt_entry_size member to
	plt_mips_entry_size.  Add plt_comp_entry_size, plt_mips_offset,
	plt_comp_offset, plt_got_index entries and plt_header_is_comp
	members.
	(STUB_LW_MICROMIPS, STUB_MOVE_MICROMIPS): New macros.
	(STUB_LUI_MICROMIPS, STUB_JALR_MICROMIPS): Likewise.
	(STUB_ORI_MICROMIPS, STUB_LI16U_MICROMIPS): Likewise.
	(STUB_LI16S_MICROMIPS): Likewise.
	(MICROMIPS_FUNCTION_STUB_NORMAL_SIZE): Likewise.
	(MICROMIPS_FUNCTION_STUB_BIG_SIZE): Likewise.
	(micromips_o32_exec_plt0_entry): New variable.
	(mips16_o32_exec_plt_entry): Likewise.
	(micromips_o32_exec_plt_entry): Likewise.
	(mips_elf_link_hash_newfunc): Initialize use_plt_entry.
	(mips_elf_output_extsym): Update to use gotplt_union's plist
	member rather than offset.
	(mips_elf_gotplt_index): Likewise.  Remove the VxWorks
	restriction.  Use MIPS_ELF_GOT_SIZE to calculate GOT address.
	(mips_elf_count_got_symbols): Update to use gotplt_union's plist
	member rather than offset.
	(mips_elf_calculate_relocation): Handle MIPS16/microMIPS PLT
	entries.
	(_bfd_mips_elf_create_dynamic_sections): Don't set PLT sizes
	here.
	(mips_elf_make_plt_record): New function.
	(_bfd_mips_elf_check_relocs): Update comment.  Record occurences
	of JAL relocations that might need a PLT entry.
	(_bfd_mips_elf_adjust_dynamic_symbol): Update to use
	gotplt_union's plist member rather than offset.  Set individual
	PLT entry sizes here.  Handle MIPS16/microMIPS PLT entries.
	Don't set the symbol's value in the symbol table for PLT
	references here.  Don't set the PLT or PLT GOT section sizes
	here.
	(mips_elf_estimate_stub_size): Handle microMIPS stubs.
	(mips_elf_allocate_lazy_stub): Likewise.
	(mips_elf_lay_out_lazy_stubs): Likewise.  Define a _MIPS_STUBS_
	magic symbol.
	(mips_elf_set_plt_sym_value): New function.
	(_bfd_mips_elf_size_dynamic_sections): Set PLT header size and
	PLT and PLT GOT section sizes here.  Set the symbol values in
	the symbol table for PLT references here.  Handle microMIPS
	annotation of the _PROCEDURE_LINKAGE_TABLE_ magic symbol.
	(_bfd_mips_elf_finish_dynamic_symbol): Update to use
	gotplt_union's plist member rather than offset.  Handle
	MIPS16/microMIPS PLT entries.  Handle microMIPS stubs.
	(_bfd_mips_vxworks_finish_dynamic_symbol): Update to use
	gotplt_union's plist member rather than offset.  Use
	MIPS_ELF_GOT_SIZE to calculate GOT address.
	(mips_finish_exec_plt): Handle microMIPS PLT.  Return status.
	(_bfd_mips_elf_finish_dynamic_sections): Handle result from
	mips_finish_exec_plt.
	(_bfd_mips_elf_link_hash_table_create): Update to use
	gotplt_union's plist member rather than offset.
	(_bfd_mips_elf_get_synthetic_symtab): New function.

	include/elf/
	* mips.h (ELF_ST_IS_MIPS_PLT): Respect STO_MIPS16 setting.
	(ELF_ST_SET_MIPS_PLT): Likewise.

	gdb/
	* mips-tdep.c (mips_elf_make_msymbol_special): Handle MIPS16 and
	microMIPS synthetic symbols.

	ld/
	* emulparams/elf32btsmip.sh: Arrange for .got.plt to be placed
	as close to .plt as possible.
	* scripttempl/elf.sc: Handle $INITIAL_READWRITE_SECTIONS and
	$PLT_NEXT_DATA variables.

	ld/testsuite/
	* ld-mips-elf/jalx-2.dd: Update for microMIPS PLT support.
	* ld-mips-elf/pic-and-nonpic-3a.dd: Update for the _MIPS_STUBS_
	magic symbol.
	* ld-mips-elf/pic-and-nonpic-3b.dd: Likewise.
	* ld-mips-elf/pic-and-nonpic-6-n32.dd: Likewise.
	* ld-mips-elf/pic-and-nonpic-6-n64.dd: Likewise.
	* ld-mips-elf/pic-and-nonpic-6-o32.dd: Likewise.
	* ld-mips-elf/stub-dynsym-1-10000.d: Likewise.
	* ld-mips-elf/stub-dynsym-1-2fe80.d: Likewise.
	* ld-mips-elf/stub-dynsym-1-7fff.d: Likewise.
	* ld-mips-elf/stub-dynsym-1-8000.d: Likewise.
	* ld-mips-elf/stub-dynsym-1-fff0.d: Likewise.
	* ld-mips-elf/tlslib-o32.d: Likewise.

	opcodes/
	* mips-dis.c (is_mips16_plt_tail): New function.
	(print_insn_mips16): Handle MIPS16 PLT entry's GOT slot address
	word.
	(is_compressed_mode_p): Handle MIPS16/microMIPS PLT entries.
2013-06-24 23:55:46 +00:00

102 lines
2.5 KiB
Text

# GOT layout:
#
# -32752: lazy resolution function
# -32744: reserved for module pointer
# -32736: extf2's GOT entry (undefined 0)
# -32728: extf3's GOT entry (PLT entry)
# -32720: extd2's GOT entry (copy reloc)
# -32712: extf1's GOT entry (.MIPS.stubs entry)
# -32704: extd1's GOT entry (undefined 0)
# -32696: extf4's GOT entry (PLT entry)
# -32688: extd4's GOT entry (undefined 0, reloc only)
.*
Disassembly of section \.plt:
0+43080 <.*>:
.*: 3c0e0008 lui t2,0x8
.*: ddd91000 ld t9,4096\(t2\)
.*: 25ce1000 addiu t2,t2,4096
.*: 030ec023 subu t8,t8,t2
.*: 03e0782d move t3,ra
.*: 0018c0c2 srl t8,t8,0x3
.*: 0320f809 jalr t9
.*: 2718fffe addiu t8,t8,-2
0+430a0 <extf4@plt>:
.*: 3c0f0008 lui t3,0x8
.*: ddf91010 ld t9,4112\(t3\)
.*: 03200008 jr t9
.*: 25f81010 addiu t8,t3,4112
0+430b0 <extf5@plt>:
.*: 3c0f0008 lui t3,0x8
.*: ddf91018 ld t9,4120\(t3\)
.*: 03200008 jr t9
.*: 25f81018 addiu t8,t3,4120
0+430c0 <extf3@plt>:
.*: 3c0f0008 lui t3,0x8
.*: ddf91020 ld t9,4128\(t3\)
.*: 03200008 jr t9
.*: 25f81020 addiu t8,t3,4128
Disassembly of section \.text:
0+44000 <.*>:
\.\.\.
0+44008 <\.pic\.f1>:
44008: 3c190004 lui t9,0x4
4400c: 27394010 addiu t9,t9,16400
0+44010 <f1>:
44010: 0c011013 jal 4404c <f3>
44014: 3c020004 lui v0,0x4
44018: 03e00008 jr ra
4401c: 24424020 addiu v0,v0,16416
0+44020 <f2>:
44020: 3c1c0006 lui gp,0x6
44024: 0399e021 addu gp,gp,t9
44028: 279c3fd0 addiu gp,gp,16336
4402c: df998038 ld t9,-32712\(gp\)
44030: df848020 ld a0,-32736\(gp\)
44034: df858040 ld a1,-32704\(gp\)
44038: 0320f809 jalr t9
4403c: df868030 ld a2,-32720\(gp\)
44040: df998028 ld t9,-32728\(gp\)
44044: 03200008 jr t9
44048: df848048 ld a0,-32696\(gp\)
0+4404c <f3>:
4404c: 03e00008 jr ra
44050: 00000000 nop
\.\.\.
0+44060 <__start>:
44060: 0c011002 jal 44008 <\.pic\.f1>
44064: 00000000 nop
44068: 3c020004 lui v0,0x4
4406c: 24424020 addiu v0,v0,16416
44070: 0c010c30 jal 430c0 <extf3@plt>
44074: 00000000 nop
44078: 0c010c28 jal 430a0 <extf4@plt>
4407c: 00000000 nop
44080: 0c010c2c jal 430b0 <extf5@plt>
44084: 00000000 nop
44088: 3c02000a lui v0,0xa
4408c: 24422000 addiu v0,v0,8192
44090: 3c02000a lui v0,0xa
44094: 24422018 addiu v0,v0,8216
\.\.\.
Disassembly of section \.MIPS\.stubs:
0+440a0 <_MIPS_STUBS_>:
440a0: df998010 ld t9,-32752\(gp\)
440a4: 03e0782d move t3,ra
440a8: 0320f809 jalr t9
440ac: 64180009 daddiu t8,zero,9
\.\.\.