bfd/
* elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Add DT_DEBUG and DT_MIPS_RLD_MAP tags for position-independent executables. Do not add DT_DEBUG to shared libraries for any MIPS target. ld/testsuite/ * ld-mips-elf/multi-got-1.d: Remove DT_DEBUG tag. Do not require a specific file offset for .dynamic. Reduce DT_HASH by 8 to account for removed tag. * ld-mips-elf/tls-multi-got-1.r: Likewise. Also reduce DT_REL by 8. Reduce PLTGOT and symbol values by 16 to account for the removed tag. * ld-mips-elf/textrel-1.d: Remove DT_DEBUG tag. * ld-mips-elf/rel32-n32.d: Reduce addresses by 16 to account for removed DT_DEBUG tag. * ld-mips-elf/rel64.d: Likewise. * ld-mips-elf/tls-multi-got-1.got: Likewise. * ld-mips-elf/tlslib-o32-hidden.got: Likewise.
This commit is contained in:
parent
76101e23e5
commit
6a4837657a
10 changed files with 62 additions and 54 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2006-10-19 Richard Sandiford <richard@codesourcery.com>
|
||||||
|
|
||||||
|
* elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Add DT_DEBUG
|
||||||
|
and DT_MIPS_RLD_MAP tags for position-independent executables.
|
||||||
|
Do not add DT_DEBUG to shared libraries for any MIPS target.
|
||||||
|
|
||||||
2006-10-18 H.J. Lu <hongjiu.lu@intel.com>
|
2006-10-18 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
PR ld/3290
|
PR ld/3290
|
||||||
|
|
|
@ -7478,7 +7478,7 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
|
||||||
must add the entries now so that we get the correct size for
|
must add the entries now so that we get the correct size for
|
||||||
the .dynamic section. The DT_DEBUG entry is filled in by the
|
the .dynamic section. The DT_DEBUG entry is filled in by the
|
||||||
dynamic linker and used by the debugger. */
|
dynamic linker and used by the debugger. */
|
||||||
if (! info->shared)
|
if (info->executable)
|
||||||
{
|
{
|
||||||
/* SGI object has the equivalence of DT_DEBUG in the
|
/* SGI object has the equivalence of DT_DEBUG in the
|
||||||
DT_MIPS_RLD_MAP entry. */
|
DT_MIPS_RLD_MAP entry. */
|
||||||
|
@ -7490,15 +7490,6 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Shared libraries on traditional mips have DT_DEBUG. */
|
|
||||||
if (!SGI_COMPAT (output_bfd))
|
|
||||||
{
|
|
||||||
if (!MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_DEBUG, 0))
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reltext && (SGI_COMPAT (output_bfd) || htab->is_vxworks))
|
if (reltext && (SGI_COMPAT (output_bfd) || htab->is_vxworks))
|
||||||
info->flags |= DF_TEXTREL;
|
info->flags |= DF_TEXTREL;
|
||||||
|
|
|
@ -1,3 +1,17 @@
|
||||||
|
2006-10-19 Richard Sandiford <richard@codesourcery.com>
|
||||||
|
|
||||||
|
* ld-mips-elf/multi-got-1.d: Remove DT_DEBUG tag. Do not require
|
||||||
|
a specific file offset for .dynamic. Reduce DT_HASH by 8 to account
|
||||||
|
for removed tag.
|
||||||
|
* ld-mips-elf/tls-multi-got-1.r: Likewise. Also reduce DT_REL by 8.
|
||||||
|
Reduce PLTGOT and symbol values by 16 to account for the removed tag.
|
||||||
|
* ld-mips-elf/textrel-1.d: Remove DT_DEBUG tag.
|
||||||
|
* ld-mips-elf/rel32-n32.d: Reduce addresses by 16 to account for
|
||||||
|
removed DT_DEBUG tag.
|
||||||
|
* ld-mips-elf/rel64.d: Likewise.
|
||||||
|
* ld-mips-elf/tls-multi-got-1.got: Likewise.
|
||||||
|
* ld-mips-elf/tlslib-o32-hidden.got: Likewise.
|
||||||
|
|
||||||
2006-10-18 H.J. Lu <hongjiu.lu@intel.com>
|
2006-10-18 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
PR ld/3290
|
PR ld/3290
|
||||||
|
|
|
@ -5,14 +5,13 @@
|
||||||
#ld: -melf32btsmip -shared
|
#ld: -melf32btsmip -shared
|
||||||
#readelf: -d -r
|
#readelf: -d -r
|
||||||
|
|
||||||
Dynamic section at offset 0xcc contains 18 entries:
|
Dynamic section at offset .* contains 17 entries:
|
||||||
Tag Type Name/Value
|
Tag Type Name/Value
|
||||||
0x00000004 \(HASH\) 0x184
|
0x00000004 \(HASH\) 0x17c
|
||||||
0x00000005 \(STRTAB\) 0x[0-9a-f]+
|
0x00000005 \(STRTAB\) 0x[0-9a-f]+
|
||||||
0x00000006 \(SYMTAB\) 0x[0-9a-f]+
|
0x00000006 \(SYMTAB\) 0x[0-9a-f]+
|
||||||
0x0000000a \(STRSZ\) [0-9]+ \(bytes\)
|
0x0000000a \(STRSZ\) [0-9]+ \(bytes\)
|
||||||
0x0000000b \(SYMENT\) 16 \(bytes\)
|
0x0000000b \(SYMENT\) 16 \(bytes\)
|
||||||
0x00000015 \(DEBUG\) 0x0
|
|
||||||
0x00000003 \(PLTGOT\) 0x[0-9a-f]+
|
0x00000003 \(PLTGOT\) 0x[0-9a-f]+
|
||||||
0x00000011 \(REL\) 0x[0-9a-f]+
|
0x00000011 \(REL\) 0x[0-9a-f]+
|
||||||
0x00000012 \(RELSZ\) 65544 \(bytes\)
|
0x00000012 \(RELSZ\) 65544 \(bytes\)
|
||||||
|
|
|
@ -10,6 +10,6 @@ Relocation section '.rel.dyn' at offset .* contains 2 entries:
|
||||||
[0-9a-f ]+R_MIPS_REL32
|
[0-9a-f ]+R_MIPS_REL32
|
||||||
|
|
||||||
Hex dump of section '.text':
|
Hex dump of section '.text':
|
||||||
0x000002d0 00000000 00000000 00000000 00000000 ................
|
0x000002c0 00000000 00000000 00000000 00000000 ................
|
||||||
0x000002e0 000002e0 00000000 00000000 00000000 ................
|
0x000002d0 000002d0 00000000 00000000 00000000 ................
|
||||||
0x000002f0 00000000 00000000 00000000 00000000 ................
|
0x000002e0 00000000 00000000 00000000 00000000 ................
|
||||||
|
|
|
@ -14,6 +14,6 @@ Relocation section '.rel.dyn' at offset .* contains 2 entries:
|
||||||
+Type3: R_MIPS_NONE
|
+Type3: R_MIPS_NONE
|
||||||
|
|
||||||
Hex dump of section '.text':
|
Hex dump of section '.text':
|
||||||
0x00000430 00000000 00000000 00000000 00000000 ................
|
0x00000420 00000000 00000000 00000000 00000000 ................
|
||||||
0x00000440 00000000 00000440 00000000 00000000 ................
|
0x00000430 00000000 00000430 00000000 00000000 ................
|
||||||
0x00000450 00000000 00000000 00000000 00000000 ................
|
0x00000440 00000000 00000000 00000000 00000000 ................
|
||||||
|
|
|
@ -4,14 +4,13 @@
|
||||||
#ld: -shared -melf32btsmipn32
|
#ld: -shared -melf32btsmipn32
|
||||||
#readelf: -d
|
#readelf: -d
|
||||||
|
|
||||||
Dynamic section at offset .* contains 18 entries:
|
Dynamic section at offset .* contains 17 entries:
|
||||||
Tag Type Name/Value
|
Tag Type Name/Value
|
||||||
0x00000004 \(HASH\) 0x[0-9a-f]*
|
0x00000004 \(HASH\) 0x[0-9a-f]*
|
||||||
0x00000005 \(STRTAB\) 0x[0-9a-f]*
|
0x00000005 \(STRTAB\) 0x[0-9a-f]*
|
||||||
0x00000006 \(SYMTAB\) 0x[0-9a-f]*
|
0x00000006 \(SYMTAB\) 0x[0-9a-f]*
|
||||||
0x0000000a \(STRSZ\) [0-9]* \(bytes\)
|
0x0000000a \(STRSZ\) [0-9]* \(bytes\)
|
||||||
0x0000000b \(SYMENT\) 16 \(bytes\)
|
0x0000000b \(SYMENT\) 16 \(bytes\)
|
||||||
0x00000015 \(DEBUG\) 0x0
|
|
||||||
0x00000003 \(PLTGOT\) 0x[0-9a-f]*
|
0x00000003 \(PLTGOT\) 0x[0-9a-f]*
|
||||||
0x00000011 \(REL\) 0x[0-9a-f]*
|
0x00000011 \(REL\) 0x[0-9a-f]*
|
||||||
0x00000012 \(RELSZ\) 8 \(bytes\)
|
0x00000012 \(RELSZ\) 8 \(bytes\)
|
||||||
|
|
|
@ -4,17 +4,17 @@
|
||||||
DYNAMIC RELOCATION RECORDS
|
DYNAMIC RELOCATION RECORDS
|
||||||
OFFSET TYPE VALUE
|
OFFSET TYPE VALUE
|
||||||
00000000 R_MIPS_NONE \*ABS\*
|
00000000 R_MIPS_NONE \*ABS\*
|
||||||
001495c0 R_MIPS_TLS_DTPMOD32 \*ABS\*
|
001495b0 R_MIPS_TLS_DTPMOD32 \*ABS\*
|
||||||
0013f938 R_MIPS_TLS_DTPMOD32 \*ABS\*
|
0013f928 R_MIPS_TLS_DTPMOD32 \*ABS\*
|
||||||
001495cc R_MIPS_TLS_DTPMOD32 tlsvar_gd
|
001495bc R_MIPS_TLS_DTPMOD32 tlsvar_gd
|
||||||
001495d0 R_MIPS_TLS_DTPREL32 tlsvar_gd
|
001495c0 R_MIPS_TLS_DTPREL32 tlsvar_gd
|
||||||
0013f944 R_MIPS_TLS_DTPMOD32 tlsvar_gd
|
0013f934 R_MIPS_TLS_DTPMOD32 tlsvar_gd
|
||||||
0013f948 R_MIPS_TLS_DTPREL32 tlsvar_gd
|
0013f938 R_MIPS_TLS_DTPREL32 tlsvar_gd
|
||||||
001495c8 R_MIPS_TLS_TPREL32 tlsvar_ie
|
001495b8 R_MIPS_TLS_TPREL32 tlsvar_ie
|
||||||
0013f940 R_MIPS_TLS_TPREL32 tlsvar_ie
|
0013f930 R_MIPS_TLS_TPREL32 tlsvar_ie
|
||||||
00143f6c R_MIPS_REL32 sym_1_9526
|
00143f5c R_MIPS_REL32 sym_1_9526
|
||||||
#...
|
#...
|
||||||
00139bc0 R_MIPS_REL32 sym_2_8654
|
00139bb0 R_MIPS_REL32 sym_2_8654
|
||||||
00000000 R_MIPS_NONE \*ABS\*
|
00000000 R_MIPS_NONE \*ABS\*
|
||||||
00000000 R_MIPS_NONE \*ABS\*
|
00000000 R_MIPS_NONE \*ABS\*
|
||||||
00000000 R_MIPS_NONE \*ABS\*
|
00000000 R_MIPS_NONE \*ABS\*
|
||||||
|
@ -40,19 +40,19 @@ OFFSET TYPE VALUE
|
||||||
|
|
||||||
|
|
||||||
Contents of section .got:
|
Contents of section .got:
|
||||||
122410 00000000 80000000 00000000 00000000 .*
|
122400 00000000 80000000 00000000 00000000 .*
|
||||||
|
122410 00000000 00000000 00000000 00000000 .*
|
||||||
122420 00000000 00000000 00000000 00000000 .*
|
122420 00000000 00000000 00000000 00000000 .*
|
||||||
122430 00000000 00000000 00000000 00000000 .*
|
122430 00000000 000d8028 000d6684 000d2034 .*
|
||||||
122440 00000000 000d8038 000d6694 000d2044 .*
|
|
||||||
#...
|
#...
|
||||||
|
13f910 00000000 00000000 00000000 00000000 .*
|
||||||
13f920 00000000 00000000 00000000 00000000 .*
|
13f920 00000000 00000000 00000000 00000000 .*
|
||||||
13f930 00000000 00000000 00000000 00000000 .*
|
13f930 00000000 00000000 00000000 00000000 .*
|
||||||
13f940 00000000 00000000 00000000 00000000 .*
|
13f940 80000000 00000000 00000000 00000000 .*
|
||||||
13f950 80000000 00000000 00000000 00000000 .*
|
|
||||||
#...
|
#...
|
||||||
|
149580 00000000 00000000 00000000 00000000 .*
|
||||||
149590 00000000 00000000 00000000 00000000 .*
|
149590 00000000 00000000 00000000 00000000 .*
|
||||||
1495a0 00000000 00000000 00000000 00000000 .*
|
1495a0 00000000 00000000 00000000 00000000 .*
|
||||||
1495b0 00000000 00000000 00000000 00000000 .*
|
1495b0 00000000 00000000 00000000 00000000 .*
|
||||||
1495c0 00000000 00000000 00000000 00000000 .*
|
1495c0 00000000 .*
|
||||||
1495d0 00000000 .*
|
|
||||||
#pass
|
#pass
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
|
|
||||||
Dynamic section at offset 0xec contains 19 entries:
|
Dynamic section at offset .* contains 18 entries:
|
||||||
Tag Type Name/Value
|
Tag Type Name/Value
|
||||||
0x00000004 \(HASH\) 0x1ac
|
0x00000004 \(HASH\) 0x1a4
|
||||||
0x00000005 \(STRTAB\).*
|
0x00000005 \(STRTAB\).*
|
||||||
0x00000006 \(SYMTAB\).*
|
0x00000006 \(SYMTAB\).*
|
||||||
0x0000000a \(STRSZ\) 220091 \(bytes\)
|
0x0000000a \(STRSZ\) 220091 \(bytes\)
|
||||||
0x0000000b \(SYMENT\) 16 \(bytes\)
|
0x0000000b \(SYMENT\) 16 \(bytes\)
|
||||||
0x00000015 \(DEBUG\) 0x0
|
0x00000003 \(PLTGOT\) 0x122400
|
||||||
0x00000003 \(PLTGOT\) 0x122410
|
0x00000011 \(REL\) 0xa7958
|
||||||
0x00000011 \(REL\) 0xa7960
|
|
||||||
0x00000012 \(RELSZ\) 160072 \(bytes\)
|
0x00000012 \(RELSZ\) 160072 \(bytes\)
|
||||||
0x00000013 \(RELENT\) 8 \(bytes\)
|
0x00000013 \(RELENT\) 8 \(bytes\)
|
||||||
0x70000001 \(MIPS_RLD_VERSION\) 1
|
0x70000001 \(MIPS_RLD_VERSION\) 1
|
||||||
|
@ -32,9 +31,9 @@ Relocation section '\.rel\.dyn' at offset 0x[0-9a-f]+ contains 20031 entries:
|
||||||
[0-9a-f ]+R_MIPS_TLS_DTPREL 00000000 tlsvar_gd
|
[0-9a-f ]+R_MIPS_TLS_DTPREL 00000000 tlsvar_gd
|
||||||
[0-9a-f ]+R_MIPS_TLS_TPREL3 00000004 tlsvar_ie
|
[0-9a-f ]+R_MIPS_TLS_TPREL3 00000004 tlsvar_ie
|
||||||
[0-9a-f ]+R_MIPS_TLS_TPREL3 00000004 tlsvar_ie
|
[0-9a-f ]+R_MIPS_TLS_TPREL3 00000004 tlsvar_ie
|
||||||
[0-9a-f ]+R_MIPS_REL32 000d8038 sym_1_9526
|
[0-9a-f ]+R_MIPS_REL32 000d8028 sym_1_9526
|
||||||
[0-9a-f ]+R_MIPS_REL32 000d6694 sym_1_7885
|
[0-9a-f ]+R_MIPS_REL32 000d6684 sym_1_7885
|
||||||
#...
|
#...
|
||||||
[0-9a-f ]+R_MIPS_REL32 000cf2a4 sym_1_0465
|
[0-9a-f ]+R_MIPS_REL32 000cf294 sym_1_0465
|
||||||
[0-9a-f ]+R_MIPS_REL32 000e0ee8 sym_2_8654
|
[0-9a-f ]+R_MIPS_REL32 000e0ed8 sym_2_8654
|
||||||
#...
|
#...
|
||||||
|
|
|
@ -4,13 +4,13 @@
|
||||||
DYNAMIC RELOCATION RECORDS
|
DYNAMIC RELOCATION RECORDS
|
||||||
OFFSET TYPE VALUE
|
OFFSET TYPE VALUE
|
||||||
00000000 R_MIPS_NONE \*ABS\*
|
00000000 R_MIPS_NONE \*ABS\*
|
||||||
000403cc R_MIPS_TLS_DTPMOD32 \*ABS\*
|
000403bc R_MIPS_TLS_DTPMOD32 \*ABS\*
|
||||||
000403c4 R_MIPS_TLS_DTPMOD32 \*ABS\*
|
000403b4 R_MIPS_TLS_DTPMOD32 \*ABS\*
|
||||||
000403c0 R_MIPS_TLS_TPREL32 \*ABS\*
|
000403b0 R_MIPS_TLS_TPREL32 \*ABS\*
|
||||||
|
|
||||||
|
|
||||||
Contents of section .got:
|
Contents of section .got:
|
||||||
403a0 00000000 80000000 00000000 00000000 ................
|
40390 00000000 80000000 00000000 00000000 ................
|
||||||
403b0 00000000 00000000 00000000 00000370 ................
|
403a0 00000000 00000000 00000000 00000360 ................
|
||||||
403c0 00000008 00000000 00000000 00000000 ................
|
403b0 00000008 00000000 00000000 00000000 ................
|
||||||
403d0 ffff8004 ....
|
403c0 ffff8004 ....
|
||||||
|
|
Loading…
Reference in a new issue