mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-30 17:31:13 +08:00
* elfcode.h (NAME(bfd_elf,record_link_assignment)): Add provide
argument. * bfd-in.h (bfd_elf32_record_link_assignment): Update prototype. (bfd_elf64_record_link_assignment): Likewise. * bfd-in2.h: Rebuild. PR 7164.
This commit is contained in:
@ -5107,10 +5107,11 @@ elf_link_read_relocs (abfd, o, external_relocs, internal_relocs, keep_memory)
|
||||
|
||||
/*ARGSUSED*/
|
||||
boolean
|
||||
NAME(bfd_elf,record_link_assignment) (output_bfd, info, name)
|
||||
NAME(bfd_elf,record_link_assignment) (output_bfd, info, name, provide)
|
||||
bfd *output_bfd;
|
||||
struct bfd_link_info *info;
|
||||
const char *name;
|
||||
boolean provide;
|
||||
{
|
||||
struct elf_link_hash_entry *h;
|
||||
|
||||
@ -5121,6 +5122,15 @@ NAME(bfd_elf,record_link_assignment) (output_bfd, info, name)
|
||||
if (h == NULL)
|
||||
return false;
|
||||
|
||||
/* If this symbol is being provided by the linker script, and it is
|
||||
currently defined by a dynamic object, but not by a regular
|
||||
object, then mark it as undefined so that the generic linker will
|
||||
force the correct value. */
|
||||
if (provide
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
h->root.type = bfd_link_hash_undefined;
|
||||
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->type = STT_OBJECT;
|
||||
|
||||
|
Reference in New Issue
Block a user