* elf-eh-frame.c (ENSURE_NO_RELOCS): Disregard R_*_NONE relocs.
(_bfd_elf_discard_section_eh_frame): Don't discard duplicate CIEs on a relocatable link. Comment typos. * elf.c (_bfd_elf_link_hash_newfunc): Assign elements of structure in the order they are declared. Clear elf_hash_value too. (_bfd_elf_link_hash_table_init): Likewise assign in order. Clear eh_info and tls_segment. * elflink.h (elf_link_input_bfd <emit_relocs>): Keep reloc offsets sorted when discarding relocs by turning them into R_*_NONE. * libbfd.c (warn_deprecated): Comment spelling. * po/SRC-POTFILES.in: Regenerate.
This commit is contained in:
parent
fb2fd3e12c
commit
73722af036
@ -1,3 +1,18 @@
|
|||||||
|
2002-11-26 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* elf-eh-frame.c (ENSURE_NO_RELOCS): Disregard R_*_NONE relocs.
|
||||||
|
(_bfd_elf_discard_section_eh_frame): Don't discard duplicate CIEs
|
||||||
|
on a relocatable link. Comment typos.
|
||||||
|
* elf.c (_bfd_elf_link_hash_newfunc): Assign elements of structure
|
||||||
|
in the order they are declared. Clear elf_hash_value too.
|
||||||
|
(_bfd_elf_link_hash_table_init): Likewise assign in order. Clear
|
||||||
|
eh_info and tls_segment.
|
||||||
|
* elflink.h (elf_link_input_bfd <emit_relocs>): Keep reloc offsets
|
||||||
|
sorted when discarding relocs by turning them into R_*_NONE.
|
||||||
|
|
||||||
|
* libbfd.c (warn_deprecated): Comment spelling.
|
||||||
|
* po/SRC-POTFILES.in: Regenerate.
|
||||||
|
|
||||||
2002-11-21 Richard Henderson <rth@redhat.com>
|
2002-11-21 Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
* elflink.h (elf_link_add_object_symbols): Don't overwrite the
|
* elflink.h (elf_link_add_object_symbols): Don't overwrite the
|
||||||
|
@ -295,7 +295,8 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec,
|
|||||||
#define ENSURE_NO_RELOCS(buf) \
|
#define ENSURE_NO_RELOCS(buf) \
|
||||||
if (cookie->rel < cookie->relend \
|
if (cookie->rel < cookie->relend \
|
||||||
&& (cookie->rel->r_offset \
|
&& (cookie->rel->r_offset \
|
||||||
< (bfd_size_type) ((buf) - ehbuf))) \
|
< (bfd_size_type) ((buf) - ehbuf)) \
|
||||||
|
&& cookie->rel->r_info != 0) \
|
||||||
goto free_no_table
|
goto free_no_table
|
||||||
|
|
||||||
#define SKIP_RELOCS(buf) \
|
#define SKIP_RELOCS(buf) \
|
||||||
@ -378,11 +379,12 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec,
|
|||||||
/* CIE */
|
/* CIE */
|
||||||
if (last_cie != NULL)
|
if (last_cie != NULL)
|
||||||
{
|
{
|
||||||
/* Now check if this CIE is identical to last CIE, in which case
|
/* Now check if this CIE is identical to the last CIE,
|
||||||
we can remove it, provided we adjust all FDEs.
|
in which case we can remove it provided we adjust
|
||||||
Also, it can be removed if we have removed all FDEs using
|
all FDEs. Also, it can be removed if we have removed
|
||||||
that. */
|
all FDEs using it. */
|
||||||
if (cie_compare (&cie, &hdr_info->last_cie) == 0
|
if ((!info->relocateable
|
||||||
|
&& cie_compare (&cie, &hdr_info->last_cie) == 0)
|
||||||
|| cie_usage_count == 0)
|
|| cie_usage_count == 0)
|
||||||
{
|
{
|
||||||
new_size -= cie.hdr.length + 4;
|
new_size -= cie.hdr.length + 4;
|
||||||
@ -560,7 +562,7 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec,
|
|||||||
goto free_no_table;
|
goto free_no_table;
|
||||||
if ((*reloc_symbol_deleted_p) (buf - ehbuf, cookie))
|
if ((*reloc_symbol_deleted_p) (buf - ehbuf, cookie))
|
||||||
{
|
{
|
||||||
/* This is a FDE against discarded section, it should
|
/* This is a FDE against a discarded section. It should
|
||||||
be deleted. */
|
be deleted. */
|
||||||
new_size -= hdr.length + 4;
|
new_size -= hdr.length + 4;
|
||||||
sec_info->entry[sec_info->count].removed = 1;
|
sec_info->entry[sec_info->count].removed = 1;
|
||||||
@ -572,7 +574,7 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec,
|
|||||||
&& cie.make_relative == 0)
|
&& cie.make_relative == 0)
|
||||||
|| (cie.fde_encoding & 0xf0) == DW_EH_PE_aligned))
|
|| (cie.fde_encoding & 0xf0) == DW_EH_PE_aligned))
|
||||||
{
|
{
|
||||||
/* If shared library uses absolute pointers
|
/* If a shared library uses absolute pointers
|
||||||
which we cannot turn into PC relative,
|
which we cannot turn into PC relative,
|
||||||
don't create the binary search table,
|
don't create the binary search table,
|
||||||
since it is affected by runtime relocations. */
|
since it is affected by runtime relocations. */
|
||||||
|
18
bfd/elf.c
18
bfd/elf.c
@ -1391,17 +1391,18 @@ _bfd_elf_link_hash_newfunc (entry, table, string)
|
|||||||
|
|
||||||
/* Set local fields. */
|
/* Set local fields. */
|
||||||
ret->indx = -1;
|
ret->indx = -1;
|
||||||
ret->size = 0;
|
|
||||||
ret->dynindx = -1;
|
ret->dynindx = -1;
|
||||||
ret->dynstr_index = 0;
|
ret->dynstr_index = 0;
|
||||||
|
ret->elf_hash_value = 0;
|
||||||
ret->weakdef = NULL;
|
ret->weakdef = NULL;
|
||||||
ret->got.refcount = htab->init_refcount;
|
|
||||||
ret->plt.refcount = htab->init_refcount;
|
|
||||||
ret->linker_section_pointer = NULL;
|
ret->linker_section_pointer = NULL;
|
||||||
ret->verinfo.verdef = NULL;
|
ret->verinfo.verdef = NULL;
|
||||||
ret->vtable_entries_used = NULL;
|
|
||||||
ret->vtable_entries_size = 0;
|
ret->vtable_entries_size = 0;
|
||||||
|
ret->vtable_entries_used = NULL;
|
||||||
ret->vtable_parent = NULL;
|
ret->vtable_parent = NULL;
|
||||||
|
ret->got.refcount = htab->init_refcount;
|
||||||
|
ret->plt.refcount = htab->init_refcount;
|
||||||
|
ret->size = 0;
|
||||||
ret->type = STT_NOTYPE;
|
ret->type = STT_NOTYPE;
|
||||||
ret->other = 0;
|
ret->other = 0;
|
||||||
/* Assume that we have been called by a non-ELF symbol reader.
|
/* Assume that we have been called by a non-ELF symbol reader.
|
||||||
@ -1512,13 +1513,16 @@ _bfd_elf_link_hash_table_init (table, abfd, newfunc)
|
|||||||
table->dynstr = NULL;
|
table->dynstr = NULL;
|
||||||
table->bucketcount = 0;
|
table->bucketcount = 0;
|
||||||
table->needed = NULL;
|
table->needed = NULL;
|
||||||
table->runpath = NULL;
|
|
||||||
table->loaded = NULL;
|
|
||||||
table->hgot = NULL;
|
table->hgot = NULL;
|
||||||
table->stab_info = NULL;
|
table->stab_info = NULL;
|
||||||
table->merge_info = NULL;
|
table->merge_info = NULL;
|
||||||
|
memset (&table->eh_info, 0, sizeof (table->eh_info));
|
||||||
table->dynlocal = NULL;
|
table->dynlocal = NULL;
|
||||||
ret = _bfd_link_hash_table_init (& table->root, abfd, newfunc);
|
table->runpath = NULL;
|
||||||
|
table->tls_segment = NULL;
|
||||||
|
table->loaded = NULL;
|
||||||
|
|
||||||
|
ret = _bfd_link_hash_table_init (&table->root, abfd, newfunc);
|
||||||
table->root.type = bfd_link_elf_hash_table;
|
table->root.type = bfd_link_elf_hash_table;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -6946,6 +6946,7 @@ elf_link_input_bfd (finfo, input_bfd)
|
|||||||
{
|
{
|
||||||
Elf_Internal_Rela *irela;
|
Elf_Internal_Rela *irela;
|
||||||
Elf_Internal_Rela *irelaend;
|
Elf_Internal_Rela *irelaend;
|
||||||
|
bfd_vma last_offset;
|
||||||
struct elf_link_hash_entry **rel_hash;
|
struct elf_link_hash_entry **rel_hash;
|
||||||
Elf_Internal_Shdr *input_rel_hdr, *input_rel_hdr2;
|
Elf_Internal_Shdr *input_rel_hdr, *input_rel_hdr2;
|
||||||
unsigned int next_erel;
|
unsigned int next_erel;
|
||||||
@ -6966,6 +6967,9 @@ elf_link_input_bfd (finfo, input_bfd)
|
|||||||
rel_hash = (elf_section_data (o->output_section)->rel_hashes
|
rel_hash = (elf_section_data (o->output_section)->rel_hashes
|
||||||
+ elf_section_data (o->output_section)->rel_count
|
+ elf_section_data (o->output_section)->rel_count
|
||||||
+ elf_section_data (o->output_section)->rel_count2);
|
+ elf_section_data (o->output_section)->rel_count2);
|
||||||
|
last_offset = o->output_offset;
|
||||||
|
if (!finfo->info->relocateable)
|
||||||
|
last_offset += o->output_section->vma;
|
||||||
for (next_erel = 0; irela < irelaend; irela++, next_erel++)
|
for (next_erel = 0; irela < irelaend; irela++, next_erel++)
|
||||||
{
|
{
|
||||||
unsigned long r_symndx;
|
unsigned long r_symndx;
|
||||||
@ -6983,8 +6987,14 @@ elf_link_input_bfd (finfo, input_bfd)
|
|||||||
irela->r_offset);
|
irela->r_offset);
|
||||||
if (irela->r_offset >= (bfd_vma) -2)
|
if (irela->r_offset >= (bfd_vma) -2)
|
||||||
{
|
{
|
||||||
/* This is a reloc for a deleted entry or somesuch. */
|
/* This is a reloc for a deleted entry or somesuch.
|
||||||
memset (irela, 0, sizeof (*irela));
|
Turn it into an R_*_NONE reloc, at the same
|
||||||
|
offset as the last reloc. elf_eh_frame.c and
|
||||||
|
elf_bfd_discard_info rely on reloc offsets
|
||||||
|
being ordered. */
|
||||||
|
irela->r_offset = last_offset;
|
||||||
|
irela->r_info = 0;
|
||||||
|
irela->r_addend = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6994,9 +7004,10 @@ elf_link_input_bfd (finfo, input_bfd)
|
|||||||
if (!finfo->info->relocateable)
|
if (!finfo->info->relocateable)
|
||||||
irela->r_offset += o->output_section->vma;
|
irela->r_offset += o->output_section->vma;
|
||||||
|
|
||||||
r_symndx = ELF_R_SYM (irela->r_info);
|
last_offset = irela->r_offset;
|
||||||
|
|
||||||
if (r_symndx == 0)
|
r_symndx = ELF_R_SYM (irela->r_info);
|
||||||
|
if (r_symndx == STN_UNDEF)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (r_symndx >= locsymcount
|
if (r_symndx >= locsymcount
|
||||||
|
@ -912,7 +912,7 @@ warn_deprecated (what, file, line, func)
|
|||||||
|
|
||||||
if (~(size_t) func & ~mask)
|
if (~(size_t) func & ~mask)
|
||||||
{
|
{
|
||||||
/* Note: seperate sentances in order to allow
|
/* Note: separate sentences in order to allow
|
||||||
for translation into other languages. */
|
for translation into other languages. */
|
||||||
if (func)
|
if (func)
|
||||||
fprintf (stderr, _("Deprecated %s called at %s line %d in %s\n"),
|
fprintf (stderr, _("Deprecated %s called at %s line %d in %s\n"),
|
||||||
|
@ -17,6 +17,8 @@ archive64.c
|
|||||||
archures.c
|
archures.c
|
||||||
armnetbsd.c
|
armnetbsd.c
|
||||||
bfd.c
|
bfd.c
|
||||||
|
bfdio.c
|
||||||
|
bfdwin.c
|
||||||
binary.c
|
binary.c
|
||||||
bout.c
|
bout.c
|
||||||
cache.c
|
cache.c
|
||||||
|
Loading…
Reference in New Issue
Block a user