GNU Binutils with patches for OS216
Revision | 886815b26678f1a166311140f5ab72cbf715beb4 (tree) |
---|---|
Time | 2009-06-16 11:07:22 |
Author | Maciej W. Rozycki <macro@linu...> |
Commiter | Maciej W. Rozycki |
bfd/
* elf32-vax.c (elf_vax_instantiate_got_entries): Skip local
symbols in GOT space calculation.
(elf_vax_relocate_section): Adjust accordingly.
@@ -1,5 +1,11 @@ | ||
1 | 1 | 2009-06-16 Maciej W. Rozycki <macro@linux-mips.org> |
2 | 2 | |
3 | + * elf32-vax.c (elf_vax_instantiate_got_entries): Skip local | |
4 | + symbols in GOT space calculation. | |
5 | + (elf_vax_relocate_section): Adjust accordingly. | |
6 | + | |
7 | +2009-06-16 Maciej W. Rozycki <macro@linux-mips.org> | |
8 | + | |
3 | 9 | * elf32-vax.c (elf_vax_plt_entry): Set the entry mask to |
4 | 10 | include <R11:R2>. |
5 | 11 |
@@ -1332,6 +1332,8 @@ elf_vax_instantiate_got_entries (struct elf_link_hash_entry *h, PTR infoptr) | ||
1332 | 1332 | } |
1333 | 1333 | else if (h->got.refcount > 0) |
1334 | 1334 | { |
1335 | + bfd_boolean dyn; | |
1336 | + | |
1335 | 1337 | /* Make sure this symbol is output as a dynamic symbol. */ |
1336 | 1338 | if (h->dynindx == -1) |
1337 | 1339 | { |
@@ -1339,9 +1341,15 @@ elf_vax_instantiate_got_entries (struct elf_link_hash_entry *h, PTR infoptr) | ||
1339 | 1341 | return FALSE; |
1340 | 1342 | } |
1341 | 1343 | |
1344 | + dyn = elf_hash_table (info)->dynamic_sections_created; | |
1342 | 1345 | /* Allocate space in the .got and .rela.got sections. */ |
1343 | - sgot->size += 4; | |
1344 | - srelgot->size += sizeof (Elf32_External_Rela); | |
1346 | + if (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT | |
1347 | + && (info->shared | |
1348 | + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))) | |
1349 | + { | |
1350 | + sgot->size += 4; | |
1351 | + srelgot->size += sizeof (Elf32_External_Rela); | |
1352 | + } | |
1345 | 1353 | } |
1346 | 1354 | |
1347 | 1355 | return TRUE; |
@@ -1485,6 +1493,7 @@ elf_vax_relocate_section (bfd *output_bfd, | ||
1485 | 1493 | the global offset table. */ |
1486 | 1494 | |
1487 | 1495 | { |
1496 | + bfd_boolean dyn; | |
1488 | 1497 | bfd_vma off; |
1489 | 1498 | |
1490 | 1499 | if (sgot == NULL) |
@@ -1498,9 +1507,10 @@ elf_vax_relocate_section (bfd *output_bfd, | ||
1498 | 1507 | BFD_ASSERT (off != (bfd_vma) -1); |
1499 | 1508 | BFD_ASSERT (off < sgot->size); |
1500 | 1509 | |
1501 | - if (info->shared | |
1502 | - && h->dynindx == -1 | |
1503 | - && h->def_regular) | |
1510 | + dyn = elf_hash_table (info)->dynamic_sections_created; | |
1511 | + if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) | |
1512 | + || (info->shared | |
1513 | + && SYMBOL_REFERENCES_LOCAL (info, h))) | |
1504 | 1514 | { |
1505 | 1515 | /* The symbol was forced to be local |
1506 | 1516 | because of a version file.. We must initialize |