mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-23 19:50:13 +08:00
* elflink.h (elf_bfd_final_link): Call elf_link_output_extsym
to output forced local syms for non-shared link. (elf_link_output_extsym): Tweak condition for calling backend adjust_dynamic_symbol so that previous behaviour is kept.
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
2002-03-05 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* elflink.h (elf_bfd_final_link): Call elf_link_output_extsym
|
||||||
|
to output forced local syms for non-shared link.
|
||||||
|
(elf_link_output_extsym): Tweak condition for calling backend
|
||||||
|
adjust_dynamic_symbol so that previous behaviour is kept.
|
||||||
|
Whitespace changes throughout file.
|
||||||
|
|
||||||
2002-03-04 H.J. Lu <hjl@gnu.org>
|
2002-03-04 H.J. Lu <hjl@gnu.org>
|
||||||
|
|
||||||
* elf.c (bfd_section_from_shdr): Handle special sections,
|
* elf.c (bfd_section_from_shdr): Handle special sections,
|
||||||
|
298
bfd/elflink.h
298
bfd/elflink.h
@ -592,7 +592,7 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash,
|
|||||||
asection *hsec;
|
asection *hsec;
|
||||||
|
|
||||||
/* This code handles the special SHN_MIPS_{TEXT,DATA} section
|
/* This code handles the special SHN_MIPS_{TEXT,DATA} section
|
||||||
indices used by MIPS ELF. */
|
indices used by MIPS ELF. */
|
||||||
switch (h->root.type)
|
switch (h->root.type)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
@ -702,10 +702,10 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash,
|
|||||||
&& sym->st_size != h->size)
|
&& sym->st_size != h->size)
|
||||||
{
|
{
|
||||||
/* Since we think we have two common symbols, issue a multiple
|
/* Since we think we have two common symbols, issue a multiple
|
||||||
common warning if desired. Note that we only warn if the
|
common warning if desired. Note that we only warn if the
|
||||||
size is different. If the size is the same, we simply let
|
size is different. If the size is the same, we simply let
|
||||||
the old symbol override the new one as normally happens with
|
the old symbol override the new one as normally happens with
|
||||||
symbols defined in dynamic objects. */
|
symbols defined in dynamic objects. */
|
||||||
|
|
||||||
if (! ((*info->callbacks->multiple_common)
|
if (! ((*info->callbacks->multiple_common)
|
||||||
(info, h->root.root.string, oldbfd, bfd_link_hash_common,
|
(info, h->root.root.string, oldbfd, bfd_link_hash_common,
|
||||||
@ -755,10 +755,10 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash,
|
|||||||
*size_change_ok = true;
|
*size_change_ok = true;
|
||||||
|
|
||||||
/* If we get here when the old symbol is a common symbol, then
|
/* If we get here when the old symbol is a common symbol, then
|
||||||
we are explicitly letting it override a weak symbol or
|
we are explicitly letting it override a weak symbol or
|
||||||
function in a dynamic object, and we don't want to warn about
|
function in a dynamic object, and we don't want to warn about
|
||||||
a type change. If the old symbol is a defined symbol, a type
|
a type change. If the old symbol is a defined symbol, a type
|
||||||
change warning may still be appropriate. */
|
change warning may still be appropriate. */
|
||||||
|
|
||||||
if (h->root.type == bfd_link_hash_common)
|
if (h->root.type == bfd_link_hash_common)
|
||||||
*type_change_ok = true;
|
*type_change_ok = true;
|
||||||
@ -817,7 +817,7 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash,
|
|||||||
olddyncommon = false;
|
olddyncommon = false;
|
||||||
|
|
||||||
/* We again permit a type change when a common symbol may be
|
/* We again permit a type change when a common symbol may be
|
||||||
overriding a function. */
|
overriding a function. */
|
||||||
|
|
||||||
if (bfd_is_com_section (sec))
|
if (bfd_is_com_section (sec))
|
||||||
*type_change_ok = true;
|
*type_change_ok = true;
|
||||||
@ -829,11 +829,11 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash,
|
|||||||
h->verinfo.vertree = NULL;
|
h->verinfo.vertree = NULL;
|
||||||
|
|
||||||
/* In this special case, if H is the target of an indirection,
|
/* In this special case, if H is the target of an indirection,
|
||||||
we want the caller to frob with H rather than with the
|
we want the caller to frob with H rather than with the
|
||||||
indirect symbol. That will permit the caller to redefine the
|
indirect symbol. That will permit the caller to redefine the
|
||||||
target of the indirection, rather than the indirect symbol
|
target of the indirection, rather than the indirect symbol
|
||||||
itself. FIXME: This will break the -y option if we store a
|
itself. FIXME: This will break the -y option if we store a
|
||||||
symbol with a different name. */
|
symbol with a different name. */
|
||||||
*sym_hash = h;
|
*sym_hash = h;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -856,7 +856,7 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash,
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* If the predumed common symbol in the dynamic object is
|
/* If the predumed common symbol in the dynamic object is
|
||||||
larger, pretend that the new symbol has its size. */
|
larger, pretend that the new symbol has its size. */
|
||||||
|
|
||||||
if (h->size > *pvalue)
|
if (h->size > *pvalue)
|
||||||
*pvalue = h->size;
|
*pvalue = h->size;
|
||||||
@ -890,8 +890,8 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash,
|
|||||||
&& bind != STB_WEAK)
|
&& bind != STB_WEAK)
|
||||||
{
|
{
|
||||||
/* To make this work we have to frob the flags so that the rest
|
/* To make this work we have to frob the flags so that the rest
|
||||||
of the code does not think we are using the regular
|
of the code does not think we are using the regular
|
||||||
definition. */
|
definition. */
|
||||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
|
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
|
||||||
h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
|
h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
|
||||||
else if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)
|
else if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)
|
||||||
@ -900,9 +900,9 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash,
|
|||||||
| ELF_LINK_HASH_DEF_DYNAMIC);
|
| ELF_LINK_HASH_DEF_DYNAMIC);
|
||||||
|
|
||||||
/* If H is the target of an indirection, we want the caller to
|
/* If H is the target of an indirection, we want the caller to
|
||||||
use H rather than the indirect symbol. Otherwise if we are
|
use H rather than the indirect symbol. Otherwise if we are
|
||||||
defining a new indirect symbol we will wind up attaching it
|
defining a new indirect symbol we will wind up attaching it
|
||||||
to the entry we are overriding. */
|
to the entry we are overriding. */
|
||||||
*sym_hash = h;
|
*sym_hash = h;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1047,7 +1047,7 @@ elf_add_default_symbol (abfd, info, h, name, sym, sec, value,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Now set HI to H, so that the following code will set the
|
/* Now set HI to H, so that the following code will set the
|
||||||
other fields correctly. */
|
other fields correctly. */
|
||||||
hi = h;
|
hi = h;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1133,7 +1133,7 @@ elf_add_default_symbol (abfd, info, h, name, sym, sec, value,
|
|||||||
& (ELF_LINK_HASH_DEF_DYNAMIC
|
& (ELF_LINK_HASH_DEF_DYNAMIC
|
||||||
| ELF_LINK_HASH_DEF_REGULAR)) == 0);
|
| ELF_LINK_HASH_DEF_REGULAR)) == 0);
|
||||||
|
|
||||||
(*bed->elf_backend_copy_indirect_symbol) (h, hi);
|
(*bed->elf_backend_copy_indirect_symbol) (h, hi);
|
||||||
|
|
||||||
/* See if the new flags lead us to realize that the symbol
|
/* See if the new flags lead us to realize that the symbol
|
||||||
must be dynamic. */
|
must be dynamic. */
|
||||||
@ -1259,8 +1259,8 @@ elf_link_add_object_symbols (abfd, info)
|
|||||||
|| h->root.type == bfd_link_hash_defweak))
|
|| h->root.type == bfd_link_hash_defweak))
|
||||||
{
|
{
|
||||||
/* We don't want to issue this warning. Clobber
|
/* We don't want to issue this warning. Clobber
|
||||||
the section size so that the warning does not
|
the section size so that the warning does not
|
||||||
get copied into the output file. */
|
get copied into the output file. */
|
||||||
s->_raw_size = 0;
|
s->_raw_size = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1284,7 +1284,7 @@ elf_link_add_object_symbols (abfd, info)
|
|||||||
if (! info->relocateable)
|
if (! info->relocateable)
|
||||||
{
|
{
|
||||||
/* Clobber the section size so that the warning does
|
/* Clobber the section size so that the warning does
|
||||||
not get copied into the output file. */
|
not get copied into the output file. */
|
||||||
s->_raw_size = 0;
|
s->_raw_size = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1315,7 +1315,7 @@ elf_link_add_object_symbols (abfd, info)
|
|||||||
goto error_return;
|
goto error_return;
|
||||||
|
|
||||||
/* Read in the symbol versions, but don't bother to convert them
|
/* Read in the symbol versions, but don't bother to convert them
|
||||||
to internal format. */
|
to internal format. */
|
||||||
if (elf_dynversym (abfd) != 0)
|
if (elf_dynversym (abfd) != 0)
|
||||||
{
|
{
|
||||||
Elf_Internal_Shdr *versymhdr;
|
Elf_Internal_Shdr *versymhdr;
|
||||||
@ -1373,10 +1373,10 @@ elf_link_add_object_symbols (abfd, info)
|
|||||||
if (! dynamic)
|
if (! dynamic)
|
||||||
{
|
{
|
||||||
/* If we are creating a shared library, create all the dynamic
|
/* If we are creating a shared library, create all the dynamic
|
||||||
sections immediately. We need to attach them to something,
|
sections immediately. We need to attach them to something,
|
||||||
so we attach them to this BFD, provided it is the right
|
so we attach them to this BFD, provided it is the right
|
||||||
format. FIXME: If there are no input BFD's of the same
|
format. FIXME: If there are no input BFD's of the same
|
||||||
format as the output, we can't make a shared library. */
|
format as the output, we can't make a shared library. */
|
||||||
if (info->shared
|
if (info->shared
|
||||||
&& is_elf_hash_table (info)
|
&& is_elf_hash_table (info)
|
||||||
&& ! hash_table->dynamic_sections_created
|
&& ! hash_table->dynamic_sections_created
|
||||||
@ -1411,7 +1411,7 @@ elf_link_add_object_symbols (abfd, info)
|
|||||||
if (*name == '\0')
|
if (*name == '\0')
|
||||||
{
|
{
|
||||||
if (elf_dt_soname (abfd) != NULL)
|
if (elf_dt_soname (abfd) != NULL)
|
||||||
dt_needed = true;
|
dt_needed = true;
|
||||||
|
|
||||||
add_needed = false;
|
add_needed = false;
|
||||||
}
|
}
|
||||||
@ -1531,7 +1531,7 @@ elf_link_add_object_symbols (abfd, info)
|
|||||||
}
|
}
|
||||||
/* Ignore DT_RPATH if we have seen DT_RUNPATH. */
|
/* Ignore DT_RPATH if we have seen DT_RUNPATH. */
|
||||||
if (!runpath && dyn.d_tag == DT_RPATH)
|
if (!runpath && dyn.d_tag == DT_RPATH)
|
||||||
{
|
{
|
||||||
struct bfd_link_needed_list *n, **pn;
|
struct bfd_link_needed_list *n, **pn;
|
||||||
char *fnm, *anm;
|
char *fnm, *anm;
|
||||||
unsigned int tagv = dyn.d_un.d_val;
|
unsigned int tagv = dyn.d_un.d_val;
|
||||||
@ -1623,7 +1623,7 @@ elf_link_add_object_symbols (abfd, info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Save the SONAME, if there is one, because sometimes the
|
/* Save the SONAME, if there is one, because sometimes the
|
||||||
linker emulation code will need to know it. */
|
linker emulation code will need to know it. */
|
||||||
if (*name == '\0')
|
if (*name == '\0')
|
||||||
name = basename (bfd_get_filename (abfd));
|
name = basename (bfd_get_filename (abfd));
|
||||||
elf_dt_name (abfd) = name;
|
elf_dt_name (abfd) = name;
|
||||||
@ -1764,10 +1764,10 @@ elf_link_add_object_symbols (abfd, info)
|
|||||||
vernum = iver.vs_vers & VERSYM_VERSION;
|
vernum = iver.vs_vers & VERSYM_VERSION;
|
||||||
|
|
||||||
/* If this is a hidden symbol, or if it is not version
|
/* If this is a hidden symbol, or if it is not version
|
||||||
1, we append the version name to the symbol name.
|
1, we append the version name to the symbol name.
|
||||||
However, we do not modify a non-hidden absolute
|
However, we do not modify a non-hidden absolute
|
||||||
symbol, because it might be the version symbol
|
symbol, because it might be the version symbol
|
||||||
itself. FIXME: What if it isn't? */
|
itself. FIXME: What if it isn't? */
|
||||||
if ((iver.vs_vers & VERSYM_HIDDEN) != 0
|
if ((iver.vs_vers & VERSYM_HIDDEN) != 0
|
||||||
|| (vernum > 1 && ! bfd_is_abs_section (sec)))
|
|| (vernum > 1 && ! bfd_is_abs_section (sec)))
|
||||||
{
|
{
|
||||||
@ -1866,10 +1866,10 @@ elf_link_add_object_symbols (abfd, info)
|
|||||||
h = (struct elf_link_hash_entry *) h->root.u.i.link;
|
h = (struct elf_link_hash_entry *) h->root.u.i.link;
|
||||||
|
|
||||||
/* Remember the old alignment if this is a common symbol, so
|
/* Remember the old alignment if this is a common symbol, so
|
||||||
that we don't reduce the alignment later on. We can't
|
that we don't reduce the alignment later on. We can't
|
||||||
check later, because _bfd_generic_link_add_one_symbol
|
check later, because _bfd_generic_link_add_one_symbol
|
||||||
will set a default for the alignment which we want to
|
will set a default for the alignment which we want to
|
||||||
override. */
|
override. */
|
||||||
if (h->root.type == bfd_link_hash_common)
|
if (h->root.type == bfd_link_hash_common)
|
||||||
old_alignment = h->root.u.c.p->alignment_power;
|
old_alignment = h->root.u.c.p->alignment_power;
|
||||||
|
|
||||||
@ -1950,10 +1950,10 @@ elf_link_add_object_symbols (abfd, info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If this is a common symbol, then we always want H->SIZE
|
/* If this is a common symbol, then we always want H->SIZE
|
||||||
to be the size of the common symbol. The code just above
|
to be the size of the common symbol. The code just above
|
||||||
won't fix the size if a common symbol becomes larger. We
|
won't fix the size if a common symbol becomes larger. We
|
||||||
don't warn about a size change here, because that is
|
don't warn about a size change here, because that is
|
||||||
covered by --warn-common. */
|
covered by --warn-common. */
|
||||||
if (h->root.type == bfd_link_hash_common)
|
if (h->root.type == bfd_link_hash_common)
|
||||||
h->size = h->root.u.c.size;
|
h->size = h->root.u.c.size;
|
||||||
|
|
||||||
@ -1983,8 +1983,8 @@ elf_link_add_object_symbols (abfd, info)
|
|||||||
h->other = sym.st_other;
|
h->other = sym.st_other;
|
||||||
|
|
||||||
/* If neither has visibility, use the st_other of the
|
/* If neither has visibility, use the st_other of the
|
||||||
definition. This is an arbitrary choice, since the
|
definition. This is an arbitrary choice, since the
|
||||||
other bits have no general meaning. */
|
other bits have no general meaning. */
|
||||||
if (!symvis && !hvis
|
if (!symvis && !hvis
|
||||||
&& (definition || h->other == 0))
|
&& (definition || h->other == 0))
|
||||||
h->other = sym.st_other;
|
h->other = sym.st_other;
|
||||||
@ -2071,7 +2071,7 @@ elf_link_add_object_symbols (abfd, info)
|
|||||||
goto error_return;
|
goto error_return;
|
||||||
|
|
||||||
/* The symbol from a DT_NEEDED object is referenced from
|
/* The symbol from a DT_NEEDED object is referenced from
|
||||||
the regular object to create a dynamic executable. We
|
the regular object to create a dynamic executable. We
|
||||||
have to make sure there is a DT_NEEDED entry for it. */
|
have to make sure there is a DT_NEEDED entry for it. */
|
||||||
|
|
||||||
dt_needed = false;
|
dt_needed = false;
|
||||||
@ -2167,10 +2167,10 @@ elf_link_add_object_symbols (abfd, info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If the real definition is in the list of dynamic
|
/* If the real definition is in the list of dynamic
|
||||||
symbols, make sure the weak definition is put there
|
symbols, make sure the weak definition is put there
|
||||||
as well. If we don't do this, then the dynamic
|
as well. If we don't do this, then the dynamic
|
||||||
loader might not merge the entries for the real
|
loader might not merge the entries for the real
|
||||||
definition and the weak definition. */
|
definition and the weak definition. */
|
||||||
if (h->dynindx != -1
|
if (h->dynindx != -1
|
||||||
&& hlook->dynindx == -1)
|
&& hlook->dynindx == -1)
|
||||||
{
|
{
|
||||||
@ -3140,11 +3140,11 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
|
|||||||
eif.failed = false;
|
eif.failed = false;
|
||||||
|
|
||||||
/* If we are supposed to export all symbols into the dynamic symbol
|
/* If we are supposed to export all symbols into the dynamic symbol
|
||||||
table (this is not the normal case), then do so. */
|
table (this is not the normal case), then do so. */
|
||||||
if (info->export_dynamic)
|
if (info->export_dynamic)
|
||||||
{
|
{
|
||||||
elf_link_hash_traverse (elf_hash_table (info), elf_export_symbol,
|
elf_link_hash_traverse (elf_hash_table (info), elf_export_symbol,
|
||||||
(PTR) &eif);
|
(PTR) &eif);
|
||||||
if (eif.failed)
|
if (eif.failed)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -3285,7 +3285,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
|
|||||||
BFD_ASSERT (s != NULL);
|
BFD_ASSERT (s != NULL);
|
||||||
|
|
||||||
/* We may have created additional version definitions if we are
|
/* We may have created additional version definitions if we are
|
||||||
just linking a regular application. */
|
just linking a regular application. */
|
||||||
verdefs = asvinfo.verdefs;
|
verdefs = asvinfo.verdefs;
|
||||||
|
|
||||||
/* Skip anonymous version tag. */
|
/* Skip anonymous version tag. */
|
||||||
@ -3870,11 +3870,11 @@ elf_fix_symbol_flags (h, eif)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Unfortunately, ELF_LINK_NON_ELF is only correct if the symbol
|
/* Unfortunately, ELF_LINK_NON_ELF is only correct if the symbol
|
||||||
was first seen in a non-ELF file. Fortunately, if the symbol
|
was first seen in a non-ELF file. Fortunately, if the symbol
|
||||||
was first seen in an ELF file, we're probably OK unless the
|
was first seen in an ELF file, we're probably OK unless the
|
||||||
symbol was defined in a non-ELF file. Catch that case here.
|
symbol was defined in a non-ELF file. Catch that case here.
|
||||||
FIXME: We're still in trouble if the symbol was first seen in
|
FIXME: We're still in trouble if the symbol was first seen in
|
||||||
a dynamic object, and then later in a non-ELF regular object. */
|
a dynamic object, and then later in a non-ELF regular object. */
|
||||||
if ((h->root.type == bfd_link_hash_defined
|
if ((h->root.type == bfd_link_hash_defined
|
||||||
|| h->root.type == bfd_link_hash_defweak)
|
|| h->root.type == bfd_link_hash_defweak)
|
||||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
|
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
|
||||||
@ -4114,14 +4114,14 @@ elf_export_symbol (h, data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!eif->verdefs)
|
if (!eif->verdefs)
|
||||||
{
|
{
|
||||||
doit:
|
doit:
|
||||||
if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h))
|
if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h))
|
||||||
{
|
{
|
||||||
eif->failed = true;
|
eif->failed = true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -4247,7 +4247,7 @@ elf_link_assign_sym_version (h, data)
|
|||||||
hidden = true;
|
hidden = true;
|
||||||
|
|
||||||
/* There are two consecutive ELF_VER_CHR characters if this is
|
/* There are two consecutive ELF_VER_CHR characters if this is
|
||||||
not a hidden symbol. */
|
not a hidden symbol. */
|
||||||
++p;
|
++p;
|
||||||
if (*p == ELF_VER_CHR)
|
if (*p == ELF_VER_CHR)
|
||||||
{
|
{
|
||||||
@ -4275,11 +4275,11 @@ elf_link_assign_sym_version (h, data)
|
|||||||
len = p - h->root.root.string;
|
len = p - h->root.root.string;
|
||||||
alc = bfd_malloc ((bfd_size_type) len);
|
alc = bfd_malloc ((bfd_size_type) len);
|
||||||
if (alc == NULL)
|
if (alc == NULL)
|
||||||
return false;
|
return false;
|
||||||
strncpy (alc, h->root.root.string, len - 1);
|
strncpy (alc, h->root.root.string, len - 1);
|
||||||
alc[len - 1] = '\0';
|
alc[len - 1] = '\0';
|
||||||
if (alc[len - 2] == ELF_VER_CHR)
|
if (alc[len - 2] == ELF_VER_CHR)
|
||||||
alc[len - 2] = '\0';
|
alc[len - 2] = '\0';
|
||||||
|
|
||||||
h->verinfo.vertree = t;
|
h->verinfo.vertree = t;
|
||||||
t->used = true;
|
t->used = true;
|
||||||
@ -4293,7 +4293,7 @@ elf_link_assign_sym_version (h, data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* See if there is anything to force this symbol to
|
/* See if there is anything to force this symbol to
|
||||||
local scope. */
|
local scope. */
|
||||||
if (d == NULL && t->locals != NULL)
|
if (d == NULL && t->locals != NULL)
|
||||||
{
|
{
|
||||||
for (d = t->locals; d != NULL; d = d->next)
|
for (d = t->locals; d != NULL; d = d->next)
|
||||||
@ -4318,14 +4318,14 @@ elf_link_assign_sym_version (h, data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If we are building an application, we need to create a
|
/* If we are building an application, we need to create a
|
||||||
version node for this version. */
|
version node for this version. */
|
||||||
if (t == NULL && ! info->shared)
|
if (t == NULL && ! info->shared)
|
||||||
{
|
{
|
||||||
struct bfd_elf_version_tree **pp;
|
struct bfd_elf_version_tree **pp;
|
||||||
int version_index;
|
int version_index;
|
||||||
|
|
||||||
/* If we aren't going to export this symbol, we don't need
|
/* If we aren't going to export this symbol, we don't need
|
||||||
to worry about it. */
|
to worry about it. */
|
||||||
if (h->dynindx == -1)
|
if (h->dynindx == -1)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@ -4361,7 +4361,7 @@ elf_link_assign_sym_version (h, data)
|
|||||||
else if (t == NULL)
|
else if (t == NULL)
|
||||||
{
|
{
|
||||||
/* We could not find the version for a symbol when
|
/* We could not find the version for a symbol when
|
||||||
generating a shared archive. Return an error. */
|
generating a shared archive. Return an error. */
|
||||||
(*_bfd_error_handler)
|
(*_bfd_error_handler)
|
||||||
(_("%s: undefined versioned symbol name %s"),
|
(_("%s: undefined versioned symbol name %s"),
|
||||||
bfd_get_filename (sinfo->output_bfd), h->root.root.string);
|
bfd_get_filename (sinfo->output_bfd), h->root.root.string);
|
||||||
@ -4383,8 +4383,8 @@ elf_link_assign_sym_version (h, data)
|
|||||||
struct bfd_elf_version_expr *d;
|
struct bfd_elf_version_expr *d;
|
||||||
|
|
||||||
/* See if can find what version this symbol is in. If the
|
/* See if can find what version this symbol is in. If the
|
||||||
symbol is supposed to be local, then don't actually register
|
symbol is supposed to be local, then don't actually register
|
||||||
it. */
|
it. */
|
||||||
deflt = NULL;
|
deflt = NULL;
|
||||||
for (t = sinfo->verdefs; t != NULL; t = t->next)
|
for (t = sinfo->verdefs; t != NULL; t = t->next)
|
||||||
{
|
{
|
||||||
@ -4904,8 +4904,8 @@ elf_bfd_final_link (abfd, info)
|
|||||||
dynobj = elf_hash_table (info)->dynobj;
|
dynobj = elf_hash_table (info)->dynobj;
|
||||||
|
|
||||||
emit_relocs = (info->relocateable
|
emit_relocs = (info->relocateable
|
||||||
|| info->emitrelocations
|
|| info->emitrelocations
|
||||||
|| bed->elf_backend_emit_relocs);
|
|| bed->elf_backend_emit_relocs);
|
||||||
|
|
||||||
finfo.info = info;
|
finfo.info = info;
|
||||||
finfo.output_bfd = abfd;
|
finfo.output_bfd = abfd;
|
||||||
@ -4975,7 +4975,7 @@ elf_bfd_final_link (abfd, info)
|
|||||||
|
|
||||||
if (info->relocateable || info->emitrelocations)
|
if (info->relocateable || info->emitrelocations)
|
||||||
o->reloc_count += sec->reloc_count;
|
o->reloc_count += sec->reloc_count;
|
||||||
else if (bed->elf_backend_count_relocs)
|
else if (bed->elf_backend_count_relocs)
|
||||||
{
|
{
|
||||||
Elf_Internal_Rela * relocs;
|
Elf_Internal_Rela * relocs;
|
||||||
|
|
||||||
@ -4983,8 +4983,8 @@ elf_bfd_final_link (abfd, info)
|
|||||||
(abfd, sec, (PTR) NULL,
|
(abfd, sec, (PTR) NULL,
|
||||||
(Elf_Internal_Rela *) NULL, info->keep_memory));
|
(Elf_Internal_Rela *) NULL, info->keep_memory));
|
||||||
|
|
||||||
o->reloc_count += (*bed->elf_backend_count_relocs)
|
o->reloc_count
|
||||||
(sec, relocs);
|
+= (*bed->elf_backend_count_relocs) (sec, relocs);
|
||||||
|
|
||||||
if (!info->keep_memory)
|
if (!info->keep_memory)
|
||||||
free (relocs);
|
free (relocs);
|
||||||
@ -5345,28 +5345,25 @@ elf_bfd_final_link (abfd, info)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Output any global symbols that got converted to local in a
|
||||||
|
version script or due to symbol visibility. We do this in a
|
||||||
|
separate step since ELF requires all local symbols to appear
|
||||||
|
prior to any global symbols. FIXME: We should only do this if
|
||||||
|
some global symbols were, in fact, converted to become local.
|
||||||
|
FIXME: Will this work correctly with the Irix 5 linker? */
|
||||||
|
eoinfo.failed = false;
|
||||||
|
eoinfo.finfo = &finfo;
|
||||||
|
eoinfo.localsyms = true;
|
||||||
|
elf_link_hash_traverse (elf_hash_table (info), elf_link_output_extsym,
|
||||||
|
(PTR) &eoinfo);
|
||||||
|
if (eoinfo.failed)
|
||||||
|
return false;
|
||||||
|
|
||||||
/* That wrote out all the local symbols. Finish up the symbol table
|
/* That wrote out all the local symbols. Finish up the symbol table
|
||||||
with the global symbols. Even if we want to strip everything we
|
with the global symbols. Even if we want to strip everything we
|
||||||
can, we still need to deal with those global symbols that got
|
can, we still need to deal with those global symbols that got
|
||||||
converted to local in a version script. */
|
converted to local in a version script. */
|
||||||
|
|
||||||
if (info->shared)
|
|
||||||
{
|
|
||||||
/* Output any global symbols that got converted to local in a
|
|
||||||
version script. We do this in a separate step since ELF
|
|
||||||
requires all local symbols to appear prior to any global
|
|
||||||
symbols. FIXME: We should only do this if some global
|
|
||||||
symbols were, in fact, converted to become local. FIXME:
|
|
||||||
Will this work correctly with the Irix 5 linker? */
|
|
||||||
eoinfo.failed = false;
|
|
||||||
eoinfo.finfo = &finfo;
|
|
||||||
eoinfo.localsyms = true;
|
|
||||||
elf_link_hash_traverse (elf_hash_table (info), elf_link_output_extsym,
|
|
||||||
(PTR) &eoinfo);
|
|
||||||
if (eoinfo.failed)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* The sh_info field records the index of the first non local symbol. */
|
/* The sh_info field records the index of the first non local symbol. */
|
||||||
symtab_hdr->sh_info = bfd_get_symcount (abfd);
|
symtab_hdr->sh_info = bfd_get_symcount (abfd);
|
||||||
|
|
||||||
@ -5418,8 +5415,8 @@ elf_bfd_final_link (abfd, info)
|
|||||||
|
|
||||||
/* Copy the internal symbol as is.
|
/* Copy the internal symbol as is.
|
||||||
Note that we saved a word of storage and overwrote
|
Note that we saved a word of storage and overwrote
|
||||||
the original st_name with the dynstr_index. */
|
the original st_name with the dynstr_index. */
|
||||||
sym = e->isym;
|
sym = e->isym;
|
||||||
|
|
||||||
if (e->isym.st_shndx != SHN_UNDEF
|
if (e->isym.st_shndx != SHN_UNDEF
|
||||||
&& (e->isym.st_shndx < SHN_LORESERVE
|
&& (e->isym.st_shndx < SHN_LORESERVE
|
||||||
@ -5696,7 +5693,7 @@ elf_bfd_final_link (abfd, info)
|
|||||||
if ((o->flags & SEC_LINKER_CREATED) == 0)
|
if ((o->flags & SEC_LINKER_CREATED) == 0)
|
||||||
{
|
{
|
||||||
/* At this point, we are only interested in sections
|
/* At this point, we are only interested in sections
|
||||||
created by elf_link_create_dynamic_sections. */
|
created by elf_link_create_dynamic_sections. */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ((elf_section_data (o->output_section)->this_hdr.sh_type
|
if ((elf_section_data (o->output_section)->this_hdr.sh_type
|
||||||
@ -5712,7 +5709,7 @@ elf_bfd_final_link (abfd, info)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* The contents of the .dynstr section are actually in a
|
/* The contents of the .dynstr section are actually in a
|
||||||
stringtab. */
|
stringtab. */
|
||||||
off = elf_section_data (o->output_section)->this_hdr.sh_offset;
|
off = elf_section_data (o->output_section)->this_hdr.sh_offset;
|
||||||
if (bfd_seek (abfd, off, SEEK_SET) != 0
|
if (bfd_seek (abfd, off, SEEK_SET) != 0
|
||||||
|| ! _bfd_elf_strtab_emit (abfd,
|
|| ! _bfd_elf_strtab_emit (abfd,
|
||||||
@ -5768,7 +5765,7 @@ elf_bfd_final_link (abfd, info)
|
|||||||
{
|
{
|
||||||
if ((o->flags & SEC_RELOC) != 0
|
if ((o->flags & SEC_RELOC) != 0
|
||||||
&& elf_section_data (o)->rel_hashes != NULL)
|
&& elf_section_data (o)->rel_hashes != NULL)
|
||||||
free (elf_section_data (o)->rel_hashes);
|
free (elf_section_data (o)->rel_hashes);
|
||||||
}
|
}
|
||||||
|
|
||||||
elf_tdata (abfd)->linker = true;
|
elf_tdata (abfd)->linker = true;
|
||||||
@ -6085,18 +6082,18 @@ elf_link_output_extsym (h, data)
|
|||||||
|
|
||||||
case bfd_link_hash_indirect:
|
case bfd_link_hash_indirect:
|
||||||
/* These symbols are created by symbol versioning. They point
|
/* These symbols are created by symbol versioning. They point
|
||||||
to the decorated version of the name. For example, if the
|
to the decorated version of the name. For example, if the
|
||||||
symbol foo@@GNU_1.2 is the default, which should be used when
|
symbol foo@@GNU_1.2 is the default, which should be used when
|
||||||
foo is used with no version, then we add an indirect symbol
|
foo is used with no version, then we add an indirect symbol
|
||||||
foo which points to foo@@GNU_1.2. We ignore these symbols,
|
foo which points to foo@@GNU_1.2. We ignore these symbols,
|
||||||
since the indirected symbol is already in the hash table. */
|
since the indirected symbol is already in the hash table. */
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case bfd_link_hash_warning:
|
case bfd_link_hash_warning:
|
||||||
/* We can't represent these symbols in ELF, although a warning
|
/* We can't represent these symbols in ELF, although a warning
|
||||||
symbol may have come from a .gnu.warning.SYMBOL section. We
|
symbol may have come from a .gnu.warning.SYMBOL section. We
|
||||||
just put the target symbol in the hash table. If the target
|
just put the target symbol in the hash table. If the target
|
||||||
symbol does not really exist, don't do anything. */
|
symbol does not really exist, don't do anything. */
|
||||||
if (h->root.u.i.link->type == bfd_link_hash_new)
|
if (h->root.u.i.link->type == bfd_link_hash_new)
|
||||||
return true;
|
return true;
|
||||||
return (elf_link_output_extsym
|
return (elf_link_output_extsym
|
||||||
@ -6105,9 +6102,12 @@ elf_link_output_extsym (h, data)
|
|||||||
|
|
||||||
/* Give the processor backend a chance to tweak the symbol value,
|
/* Give the processor backend a chance to tweak the symbol value,
|
||||||
and also to finish up anything that needs to be done for this
|
and also to finish up anything that needs to be done for this
|
||||||
symbol. */
|
symbol. FIXME: Not calling elf_backend_finish_dynamic_symbol for
|
||||||
|
forced local syms when non-shared is due to a historical quirk. */
|
||||||
if ((h->dynindx != -1
|
if ((h->dynindx != -1
|
||||||
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
|
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
|
||||||
|
&& (finfo->info->shared
|
||||||
|
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||||
&& elf_hash_table (finfo->info)->dynamic_sections_created)
|
&& elf_hash_table (finfo->info)->dynamic_sections_created)
|
||||||
{
|
{
|
||||||
struct elf_backend_data *bed;
|
struct elf_backend_data *bed;
|
||||||
@ -6361,8 +6361,8 @@ elf_link_input_bfd (finfo, input_bfd)
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
emit_relocs = (finfo->info->relocateable
|
emit_relocs = (finfo->info->relocateable
|
||||||
|| finfo->info->emitrelocations
|
|| finfo->info->emitrelocations
|
||||||
|| bed->elf_backend_emit_relocs);
|
|| bed->elf_backend_emit_relocs);
|
||||||
|
|
||||||
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
|
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
|
||||||
if (elf_bad_symtab (input_bfd))
|
if (elf_bad_symtab (input_bfd))
|
||||||
@ -6478,10 +6478,10 @@ elf_link_input_bfd (finfo, input_bfd)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* If this symbol is defined in a section which we are
|
/* If this symbol is defined in a section which we are
|
||||||
discarding, we don't need to keep it, but note that
|
discarding, we don't need to keep it, but note that
|
||||||
linker_mark is only reliable for sections that have contents.
|
linker_mark is only reliable for sections that have contents.
|
||||||
For the benefit of the MIPS ELF linker, we check SEC_EXCLUDE
|
For the benefit of the MIPS ELF linker, we check SEC_EXCLUDE
|
||||||
as well as linker_mark. */
|
as well as linker_mark. */
|
||||||
if ((isym->st_shndx < SHN_LORESERVE || isym->st_shndx > SHN_HIRESERVE)
|
if ((isym->st_shndx < SHN_LORESERVE || isym->st_shndx > SHN_HIRESERVE)
|
||||||
&& isec != NULL
|
&& isec != NULL
|
||||||
&& ((! isec->linker_mark && (isec->flags & SEC_HAS_CONTENTS) != 0)
|
&& ((! isec->linker_mark && (isec->flags & SEC_HAS_CONTENTS) != 0)
|
||||||
@ -6556,9 +6556,9 @@ elf_link_input_bfd (finfo, input_bfd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Get the contents of the section. They have been cached by a
|
/* Get the contents of the section. They have been cached by a
|
||||||
relaxation routine. Note that o is a section in an input
|
relaxation routine. Note that o is a section in an input
|
||||||
file, so the contents field will not have been set by any of
|
file, so the contents field will not have been set by any of
|
||||||
the routines which work on output files. */
|
the routines which work on output files. */
|
||||||
if (elf_section_data (o)->this_hdr.contents != NULL)
|
if (elf_section_data (o)->this_hdr.contents != NULL)
|
||||||
contents = elf_section_data (o)->this_hdr.contents;
|
contents = elf_section_data (o)->this_hdr.contents;
|
||||||
else
|
else
|
||||||
@ -6868,23 +6868,23 @@ elf_link_input_bfd (finfo, input_bfd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Swap out the relocs. */
|
/* Swap out the relocs. */
|
||||||
if (bed->elf_backend_emit_relocs
|
if (bed->elf_backend_emit_relocs
|
||||||
&& !(finfo->info->relocateable
|
&& !(finfo->info->relocateable
|
||||||
|| finfo->info->emitrelocations))
|
|| finfo->info->emitrelocations))
|
||||||
reloc_emitter = bed->elf_backend_emit_relocs;
|
reloc_emitter = bed->elf_backend_emit_relocs;
|
||||||
else
|
else
|
||||||
reloc_emitter = elf_link_output_relocs;
|
reloc_emitter = elf_link_output_relocs;
|
||||||
|
|
||||||
input_rel_hdr = &elf_section_data (o)->rel_hdr;
|
input_rel_hdr = &elf_section_data (o)->rel_hdr;
|
||||||
(*reloc_emitter) (output_bfd, o, input_rel_hdr, internal_relocs);
|
(*reloc_emitter) (output_bfd, o, input_rel_hdr, internal_relocs);
|
||||||
|
|
||||||
input_rel_hdr = elf_section_data (o)->rel_hdr2;
|
input_rel_hdr = elf_section_data (o)->rel_hdr2;
|
||||||
if (input_rel_hdr)
|
if (input_rel_hdr)
|
||||||
{
|
{
|
||||||
internal_relocs += (NUM_SHDR_ENTRIES (input_rel_hdr)
|
internal_relocs += (NUM_SHDR_ENTRIES (input_rel_hdr)
|
||||||
* bed->s->int_rels_per_ext_rel);
|
* bed->s->int_rels_per_ext_rel);
|
||||||
reloc_emitter (output_bfd, o, input_rel_hdr, internal_relocs);
|
reloc_emitter (output_bfd, o, input_rel_hdr, internal_relocs);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6984,7 +6984,7 @@ elf_reloc_link_order (output_bfd, info, output_section, link_order)
|
|||||||
struct elf_link_hash_entry *h;
|
struct elf_link_hash_entry *h;
|
||||||
|
|
||||||
/* Treat a reloc against a defined symbol as though it were
|
/* Treat a reloc against a defined symbol as though it were
|
||||||
actually against the section. */
|
actually against the section. */
|
||||||
h = ((struct elf_link_hash_entry *)
|
h = ((struct elf_link_hash_entry *)
|
||||||
bfd_wrapped_link_hash_lookup (output_bfd, info,
|
bfd_wrapped_link_hash_lookup (output_bfd, info,
|
||||||
link_order->u.reloc.p->u.name,
|
link_order->u.reloc.p->u.name,
|
||||||
@ -6999,8 +6999,8 @@ elf_reloc_link_order (output_bfd, info, output_section, link_order)
|
|||||||
indx = section->output_section->target_index;
|
indx = section->output_section->target_index;
|
||||||
*rel_hash_ptr = NULL;
|
*rel_hash_ptr = NULL;
|
||||||
/* It seems that we ought to add the symbol value to the
|
/* It seems that we ought to add the symbol value to the
|
||||||
addend here, but in practice it has already been added
|
addend here, but in practice it has already been added
|
||||||
because it was passed to constructor_callback. */
|
because it was passed to constructor_callback. */
|
||||||
addend += section->output_section->vma + section->output_offset;
|
addend += section->output_section->vma + section->output_offset;
|
||||||
}
|
}
|
||||||
else if (h != NULL)
|
else if (h != NULL)
|
||||||
@ -7473,7 +7473,7 @@ elf_gc_mark (info, sec, gc_mark_hook)
|
|||||||
if (elf_bad_symtab (input_bfd))
|
if (elf_bad_symtab (input_bfd))
|
||||||
{
|
{
|
||||||
nlocsyms = symtab_hdr->sh_size / sizeof (Elf_External_Sym);
|
nlocsyms = symtab_hdr->sh_size / sizeof (Elf_External_Sym);
|
||||||
extsymoff = 0;
|
extsymoff = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
extsymoff = nlocsyms = symtab_hdr->sh_info;
|
extsymoff = nlocsyms = symtab_hdr->sh_info;
|
||||||
@ -7535,11 +7535,11 @@ elf_gc_mark (info, sec, gc_mark_hook)
|
|||||||
locsym_shndx + (locsym_shndx ? r_symndx : 0),
|
locsym_shndx + (locsym_shndx ? r_symndx : 0),
|
||||||
&s);
|
&s);
|
||||||
if (ELF_ST_BIND (s.st_info) == STB_LOCAL)
|
if (ELF_ST_BIND (s.st_info) == STB_LOCAL)
|
||||||
rsec = (*gc_mark_hook) (sec->owner, info, rel, NULL, &s);
|
rsec = (*gc_mark_hook) (sec->owner, info, rel, NULL, &s);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
h = sym_hashes[r_symndx - extsymoff];
|
h = sym_hashes[r_symndx - extsymoff];
|
||||||
rsec = (*gc_mark_hook) (sec->owner, info, rel, h, NULL);
|
rsec = (*gc_mark_hook) (sec->owner, info, rel, h, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (r_symndx >= nlocsyms)
|
else if (r_symndx >= nlocsyms)
|
||||||
@ -7710,9 +7710,9 @@ elf_gc_propagate_vtable_entries_used (h, okp)
|
|||||||
pu = h->vtable_parent->vtable_entries_used;
|
pu = h->vtable_parent->vtable_entries_used;
|
||||||
if (pu != NULL)
|
if (pu != NULL)
|
||||||
{
|
{
|
||||||
asection *sec = h->root.u.def.section;
|
asection *sec = h->root.u.def.section;
|
||||||
struct elf_backend_data *bed = get_elf_backend_data (sec->owner);
|
struct elf_backend_data *bed = get_elf_backend_data (sec->owner);
|
||||||
int file_align = bed->s->file_align;
|
int file_align = bed->s->file_align;
|
||||||
|
|
||||||
n = h->vtable_parent->vtable_entries_size / file_align;
|
n = h->vtable_parent->vtable_entries_size / file_align;
|
||||||
while (n--)
|
while (n--)
|
||||||
@ -7789,7 +7789,7 @@ elf_gc_sections (abfd, info)
|
|||||||
bfd *sub;
|
bfd *sub;
|
||||||
asection * (*gc_mark_hook)
|
asection * (*gc_mark_hook)
|
||||||
PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *,
|
PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *,
|
||||||
struct elf_link_hash_entry *h, Elf_Internal_Sym *));
|
struct elf_link_hash_entry *h, Elf_Internal_Sym *));
|
||||||
|
|
||||||
if (!get_elf_backend_data (abfd)->can_gc_sections
|
if (!get_elf_backend_data (abfd)->can_gc_sections
|
||||||
|| info->relocateable || info->emitrelocations
|
|| info->relocateable || info->emitrelocations
|
||||||
@ -7823,7 +7823,7 @@ elf_gc_sections (abfd, info)
|
|||||||
for (o = sub->sections; o != NULL; o = o->next)
|
for (o = sub->sections; o != NULL; o = o->next)
|
||||||
{
|
{
|
||||||
if (o->flags & SEC_KEEP)
|
if (o->flags & SEC_KEEP)
|
||||||
if (!elf_gc_mark (info, o, gc_mark_hook))
|
if (!elf_gc_mark (info, o, gc_mark_hook))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -8243,24 +8243,24 @@ elf_bfd_discard_info (output_bfd, info)
|
|||||||
|
|
||||||
freesyms = NULL;
|
freesyms = NULL;
|
||||||
if (symtab_hdr->contents)
|
if (symtab_hdr->contents)
|
||||||
cookie.locsyms = (void *) symtab_hdr->contents;
|
cookie.locsyms = (void *) symtab_hdr->contents;
|
||||||
else if (cookie.locsymcount == 0)
|
else if (cookie.locsymcount == 0)
|
||||||
cookie.locsyms = NULL;
|
cookie.locsyms = NULL;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bfd_size_type amt = cookie.locsymcount * sizeof (Elf_External_Sym);
|
bfd_size_type amt = cookie.locsymcount * sizeof (Elf_External_Sym);
|
||||||
cookie.locsyms = bfd_malloc (amt);
|
cookie.locsyms = bfd_malloc (amt);
|
||||||
if (cookie.locsyms == NULL)
|
if (cookie.locsyms == NULL)
|
||||||
return false;
|
return false;
|
||||||
freesyms = cookie.locsyms;
|
freesyms = cookie.locsyms;
|
||||||
if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0
|
if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0
|
||||||
|| bfd_bread (cookie.locsyms, amt, abfd) != amt)
|
|| bfd_bread (cookie.locsyms, amt, abfd) != amt)
|
||||||
{
|
{
|
||||||
error_ret_free_loc:
|
error_ret_free_loc:
|
||||||
free (cookie.locsyms);
|
free (cookie.locsyms);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cookie.locsym_shndx = NULL;
|
cookie.locsym_shndx = NULL;
|
||||||
if (shndx_hdr->sh_size != 0 && cookie.locsymcount != 0)
|
if (shndx_hdr->sh_size != 0 && cookie.locsymcount != 0)
|
||||||
|
Reference in New Issue
Block a user