mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 04:00:07 +08:00
bfd/
* libcoff-in.h (xcoff_section_tdata): Update commentary. * libcoff.h: Regenerate. * xcofflink.c (xcoff_link_add_symbols): Set the csect of XTY_ER symbols to bfd_und_section_ptr or bfd_abs_section_ptr, rather than the previous symbol's csect. Treat last_symndx as an inclusive value and simplify its handling. (xcoff_mark): Treat last_symndx as an inclusive value. Only mark symbols with the right csect. Don't mark rsec when processing relocations against undefined or absolute sections. (bfd_xcoff_size_dynamic_sections): Don't check the SEC_MARK flag of bfd_und_section_ptr. (xcoff_link_input_bfd): Likewise.
This commit is contained in:
@ -1,3 +1,18 @@
|
|||||||
|
2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
|
||||||
|
|
||||||
|
* libcoff-in.h (xcoff_section_tdata): Update commentary.
|
||||||
|
* libcoff.h: Regenerate.
|
||||||
|
* xcofflink.c (xcoff_link_add_symbols): Set the csect of XTY_ER
|
||||||
|
symbols to bfd_und_section_ptr or bfd_abs_section_ptr, rather than
|
||||||
|
the previous symbol's csect. Treat last_symndx as an inclusive value
|
||||||
|
and simplify its handling.
|
||||||
|
(xcoff_mark): Treat last_symndx as an inclusive value. Only mark
|
||||||
|
symbols with the right csect. Don't mark rsec when processing
|
||||||
|
relocations against undefined or absolute sections.
|
||||||
|
(bfd_xcoff_size_dynamic_sections): Don't check the SEC_MARK flag
|
||||||
|
of bfd_und_section_ptr.
|
||||||
|
(xcoff_link_input_bfd): Likewise.
|
||||||
|
|
||||||
2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
|
2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
|
||||||
|
|
||||||
* coff-rs6000.c (xcoff_ppc_relocate_section): Report relocations
|
* coff-rs6000.c (xcoff_ppc_relocate_section): Report relocations
|
||||||
|
@ -215,8 +215,7 @@ struct xcoff_section_tdata
|
|||||||
/* The lineno_count field for the enclosing section, because we are
|
/* The lineno_count field for the enclosing section, because we are
|
||||||
going to clobber it there. */
|
going to clobber it there. */
|
||||||
unsigned int lineno_count;
|
unsigned int lineno_count;
|
||||||
/* The first and one past the last symbol indices for symbols used
|
/* The first and last symbol indices for symbols used by this csect. */
|
||||||
by this csect. */
|
|
||||||
unsigned long first_symndx;
|
unsigned long first_symndx;
|
||||||
unsigned long last_symndx;
|
unsigned long last_symndx;
|
||||||
};
|
};
|
||||||
|
@ -219,8 +219,7 @@ struct xcoff_section_tdata
|
|||||||
/* The lineno_count field for the enclosing section, because we are
|
/* The lineno_count field for the enclosing section, because we are
|
||||||
going to clobber it there. */
|
going to clobber it there. */
|
||||||
unsigned int lineno_count;
|
unsigned int lineno_count;
|
||||||
/* The first and one past the last symbol indices for symbols used
|
/* The first and last symbol indices for symbols used by this csect. */
|
||||||
by this csect. */
|
|
||||||
unsigned long first_symndx;
|
unsigned long first_symndx;
|
||||||
unsigned long last_symndx;
|
unsigned long last_symndx;
|
||||||
};
|
};
|
||||||
|
@ -1092,17 +1092,9 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
|
|||||||
Normally csect is a .pr, .rw etc. created in the loop
|
Normally csect is a .pr, .rw etc. created in the loop
|
||||||
If C_FILE or first time, handle special
|
If C_FILE or first time, handle special
|
||||||
|
|
||||||
Advance esym, sym_hash, csect_hash ptr's
|
Advance esym, sym_hash, csect_hash ptrs. */
|
||||||
Keep track of the last_symndx for the current file. */
|
if (sym.n_sclass == C_FILE)
|
||||||
if (sym.n_sclass == C_FILE && csect != NULL)
|
|
||||||
{
|
|
||||||
xcoff_section_data (abfd, csect)->last_symndx =
|
|
||||||
((esym
|
|
||||||
- (bfd_byte *) obj_coff_external_syms (abfd))
|
|
||||||
/ symesz);
|
|
||||||
csect = NULL;
|
csect = NULL;
|
||||||
}
|
|
||||||
|
|
||||||
if (csect != NULL)
|
if (csect != NULL)
|
||||||
*csect_cache = csect;
|
*csect_cache = csect;
|
||||||
else if (first_csect == NULL || sym.n_sclass == C_FILE)
|
else if (first_csect == NULL || sym.n_sclass == C_FILE)
|
||||||
@ -1253,13 +1245,6 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case XTY_SD:
|
case XTY_SD:
|
||||||
/* This is a csect definition. */
|
|
||||||
if (csect != NULL)
|
|
||||||
{
|
|
||||||
xcoff_section_data (abfd, csect)->last_symndx =
|
|
||||||
((esym - (bfd_byte *) obj_coff_external_syms (abfd)) / symesz);
|
|
||||||
}
|
|
||||||
|
|
||||||
csect = NULL;
|
csect = NULL;
|
||||||
csect_index = -(unsigned) 1;
|
csect_index = -(unsigned) 1;
|
||||||
|
|
||||||
@ -1541,14 +1526,6 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
|
|||||||
named .tocbss, and rely on the linker script to put that
|
named .tocbss, and rely on the linker script to put that
|
||||||
in the TOC area. */
|
in the TOC area. */
|
||||||
|
|
||||||
if (csect != NULL)
|
|
||||||
{
|
|
||||||
xcoff_section_data (abfd, csect)->last_symndx =
|
|
||||||
((esym
|
|
||||||
- (bfd_byte *) obj_coff_external_syms (abfd))
|
|
||||||
/ symesz);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (aux.x_csect.x_smclas == XMC_TD)
|
if (aux.x_csect.x_smclas == XMC_TD)
|
||||||
{
|
{
|
||||||
/* The linker script puts the .td section in the data
|
/* The linker script puts the .td section in the data
|
||||||
@ -1805,7 +1782,15 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (smtyp == XTY_ER)
|
||||||
|
*csect_cache = section;
|
||||||
|
else
|
||||||
|
{
|
||||||
*csect_cache = csect;
|
*csect_cache = csect;
|
||||||
|
if (csect != NULL)
|
||||||
|
xcoff_section_data (abfd, csect)->last_symndx
|
||||||
|
= (esym - (bfd_byte *) obj_coff_external_syms (abfd)) / symesz;
|
||||||
|
}
|
||||||
|
|
||||||
esym += (sym.n_numaux + 1) * symesz;
|
esym += (sym.n_numaux + 1) * symesz;
|
||||||
sym_hash += sym.n_numaux + 1;
|
sym_hash += sym.n_numaux + 1;
|
||||||
@ -2472,26 +2457,24 @@ xcoff_mark (struct bfd_link_info *info, asection *sec)
|
|||||||
&& coff_section_data (sec->owner, sec) != NULL
|
&& coff_section_data (sec->owner, sec) != NULL
|
||||||
&& xcoff_section_data (sec->owner, sec) != NULL)
|
&& xcoff_section_data (sec->owner, sec) != NULL)
|
||||||
{
|
{
|
||||||
struct xcoff_link_hash_entry **hp, **hpend;
|
struct xcoff_link_hash_entry **syms;
|
||||||
struct internal_reloc *rel, *relend;
|
struct internal_reloc *rel, *relend;
|
||||||
|
asection **csects;
|
||||||
|
unsigned long i, first, last;
|
||||||
|
|
||||||
/* Mark all the symbols in this section. */
|
/* Mark all the symbols in this section. */
|
||||||
hp = (obj_xcoff_sym_hashes (sec->owner)
|
syms = obj_xcoff_sym_hashes (sec->owner);
|
||||||
+ xcoff_section_data (sec->owner, sec)->first_symndx);
|
csects = xcoff_data (sec->owner)->csects;
|
||||||
hpend = (obj_xcoff_sym_hashes (sec->owner)
|
first = xcoff_section_data (sec->owner, sec)->first_symndx;
|
||||||
+ xcoff_section_data (sec->owner, sec)->last_symndx);
|
last = xcoff_section_data (sec->owner, sec)->last_symndx;
|
||||||
for (; hp < hpend; hp++)
|
for (i = first; i <= last; i++)
|
||||||
|
if (csects[i] == sec
|
||||||
|
&& syms[i] != NULL
|
||||||
|
&& (syms[i]->flags & XCOFF_MARK) == 0)
|
||||||
{
|
{
|
||||||
struct xcoff_link_hash_entry *h;
|
if (!xcoff_mark_symbol (info, syms[i]))
|
||||||
|
|
||||||
h = *hp;
|
|
||||||
if (h != NULL
|
|
||||||
&& (h->flags & XCOFF_MARK) == 0)
|
|
||||||
{
|
|
||||||
if (! xcoff_mark_symbol (info, h))
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Look through the section relocs. */
|
/* Look through the section relocs. */
|
||||||
if ((sec->flags & SEC_RELOC) != 0
|
if ((sec->flags & SEC_RELOC) != 0
|
||||||
@ -2521,6 +2504,8 @@ xcoff_mark (struct bfd_link_info *info, asection *sec)
|
|||||||
|
|
||||||
rsec = xcoff_data (sec->owner)->csects[rel->r_symndx];
|
rsec = xcoff_data (sec->owner)->csects[rel->r_symndx];
|
||||||
if (rsec != NULL
|
if (rsec != NULL
|
||||||
|
&& !bfd_is_und_section (rsec)
|
||||||
|
&& !bfd_is_abs_section (rsec)
|
||||||
&& (rsec->flags & SEC_MARK) == 0)
|
&& (rsec->flags & SEC_MARK) == 0)
|
||||||
{
|
{
|
||||||
if (! xcoff_mark (info, rsec))
|
if (! xcoff_mark (info, rsec))
|
||||||
@ -3358,8 +3343,9 @@ bfd_xcoff_size_dynamic_sections (bfd *output_bfd,
|
|||||||
if (sym._n._n_n._n_zeroes == 0
|
if (sym._n._n_n._n_zeroes == 0
|
||||||
&& *csectpp != NULL
|
&& *csectpp != NULL
|
||||||
&& (! gc
|
&& (! gc
|
||||||
|| ((*csectpp)->flags & SEC_MARK) != 0
|
|| bfd_is_abs_section (*csectpp)
|
||||||
|| *csectpp == bfd_abs_section_ptr)
|
|| bfd_is_und_section (*csectpp)
|
||||||
|
|| ((*csectpp)->flags & SEC_MARK) != 0)
|
||||||
&& bfd_coff_symname_in_debug (sub, &sym))
|
&& bfd_coff_symname_in_debug (sub, &sym))
|
||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
@ -3648,8 +3634,9 @@ xcoff_link_input_bfd (struct xcoff_final_link_info *finfo,
|
|||||||
symbol. */
|
symbol. */
|
||||||
if (! skip
|
if (! skip
|
||||||
&& xcoff_hash_table (finfo->info)->gc
|
&& xcoff_hash_table (finfo->info)->gc
|
||||||
&& ((*csectpp)->flags & SEC_MARK) == 0
|
&& !bfd_is_abs_section (*csectpp)
|
||||||
&& *csectpp != bfd_abs_section_ptr)
|
&& !bfd_is_und_section (*csectpp)
|
||||||
|
&& ((*csectpp)->flags & SEC_MARK) == 0)
|
||||||
skip = TRUE;
|
skip = TRUE;
|
||||||
|
|
||||||
/* An XCOFF linker always skips C_STAT symbols. */
|
/* An XCOFF linker always skips C_STAT symbols. */
|
||||||
|
Reference in New Issue
Block a user