mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-02-17 13:10:12 +08:00
include/
* bfdlink.h (struct bfd_link_hash_entry): Add u.undef.weak. bfd/ * linker.c (_bfd_generic_link_add_one_symbol): Set u.undef.weak. * elflink.c (elf_smash_syms): Restore symbols that were undefweak before the as-needed lib was loaded. Abort on unexpected refs.
This commit is contained in:
parent
474867c124
commit
11f25ea6ca
@ -1,3 +1,9 @@
|
|||||||
|
2005-02-03 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* linker.c (_bfd_generic_link_add_one_symbol): Set u.undef.weak.
|
||||||
|
* elflink.c (elf_smash_syms): Restore symbols that were undefweak
|
||||||
|
before the as-needed lib was loaded. Abort on unexpected refs.
|
||||||
|
|
||||||
2005-02-02 Alan Modra <amodra@bigpond.net.au>
|
2005-02-02 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
* elflink.c (elf_smash_syms): Expand comments.
|
* elflink.c (elf_smash_syms): Expand comments.
|
||||||
|
@ -2842,6 +2842,21 @@ elf_smash_syms (struct elf_link_hash_entry *h, void *data)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case bfd_link_hash_undefined:
|
case bfd_link_hash_undefined:
|
||||||
|
if (h->root.u.undef.abfd != inf->not_needed)
|
||||||
|
return TRUE;
|
||||||
|
if (h->root.u.undef.weak != NULL)
|
||||||
|
{
|
||||||
|
/* Symbol was undefweak in u.undef.weak bfd, and has become
|
||||||
|
undefined in as-needed lib. Restore weak. */
|
||||||
|
h->root.type = bfd_link_hash_undefweak;
|
||||||
|
h->root.u.undef.abfd = h->root.u.undef.weak;
|
||||||
|
if (h->root.u.undef.next != NULL
|
||||||
|
|| inf->htab->root.undefs_tail == &h->root)
|
||||||
|
inf->twiddled = TRUE;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case bfd_link_hash_undefweak:
|
case bfd_link_hash_undefweak:
|
||||||
if (h->root.u.undef.abfd != inf->not_needed)
|
if (h->root.u.undef.abfd != inf->not_needed)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -2868,6 +2883,11 @@ elf_smash_syms (struct elf_link_hash_entry *h, void *data)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* There is no way we can undo symbol table state from defined or
|
||||||
|
defweak back to undefined. */
|
||||||
|
if (h->ref_regular)
|
||||||
|
abort ();
|
||||||
|
|
||||||
/* Set sym back to newly created state, but keep undefs list pointer. */
|
/* Set sym back to newly created state, but keep undefs list pointer. */
|
||||||
bh = h->root.u.undef.next;
|
bh = h->root.u.undef.next;
|
||||||
if (bh != NULL || inf->htab->root.undefs_tail == &h->root)
|
if (bh != NULL || inf->htab->root.undefs_tail == &h->root)
|
||||||
|
@ -1604,6 +1604,7 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
|
|||||||
/* Make a new weak undefined symbol. */
|
/* Make a new weak undefined symbol. */
|
||||||
h->type = bfd_link_hash_undefweak;
|
h->type = bfd_link_hash_undefweak;
|
||||||
h->u.undef.abfd = abfd;
|
h->u.undef.abfd = abfd;
|
||||||
|
h->u.undef.weak = abfd;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CDEF:
|
case CDEF:
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
2005-02-03 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* bfdlink.h (struct bfd_link_hash_entry): Add u.undef.weak.
|
||||||
|
|
||||||
2005-02-01 Alan Modra <amodra@bigpond.net.au>
|
2005-02-01 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
* bfdlink.h (bfd_link_repair_undef_list): Declare.
|
* bfdlink.h (bfd_link_repair_undef_list): Declare.
|
||||||
|
@ -113,6 +113,7 @@ struct bfd_link_hash_entry
|
|||||||
undefined symbol list. */
|
undefined symbol list. */
|
||||||
struct bfd_link_hash_entry *next;
|
struct bfd_link_hash_entry *next;
|
||||||
bfd *abfd; /* BFD symbol was found in. */
|
bfd *abfd; /* BFD symbol was found in. */
|
||||||
|
bfd *weak; /* BFD weak symbol was found in. */
|
||||||
} undef;
|
} undef;
|
||||||
/* bfd_link_hash_defined, bfd_link_hash_defweak. */
|
/* bfd_link_hash_defined, bfd_link_hash_defweak. */
|
||||||
struct
|
struct
|
||||||
|
Loading…
Reference in New Issue
Block a user