* ldlang.h (lang_input_section_type): Remove "ifile" field.

(lang_insert_orphan, lang_add_section): Update prototypes.
	* ldlang.c (lang_insert_orphan): Remove "file" param.
	(lang_add_section): Likewise.  Update all callers.
	(wild_sort): Get an input section's bfd via "section->owner".
	(size_input_section): Access just_syms_flag via bfd usrdata.
	(lang_place_orphans): Update ldemul_place_orphan call.
	* ldemul.h (ldemul_place_orphan): Remove input_statement param.
	(struct ld_emulation_xfer_struct <place_orphan>): Likewise.
	* ldemul.c (ldemul_place_orphan): Likewise.
	* ldwrite.c (build_link_order): Access just_syms_flag via bfd usrdata.
	* emultempl/armelf.em (arm_elf_set_bfd_for_interworking): Likewise.
	* emultempl/beos.em (sort_by_file_name): Access bfd by section->owner.
	(sort_sections): Likewise.
	(place_orphan): Remove "file" param.  Adjust lang_add_section call.
	* emultempl/elf32.em (place_orphan): Remove "file" param.  Adjust
	lang_add_section and lang_insert_orphan calls.
	* emultempl/hppaelf.em (hppaelf_add_stub_section): Adjust
	lang_add_section call.
	(build_section_lists): Access just_syms_flag via bfd usrdata.
	* emultempl/m68hc1xelf.em (m68hc11elf_add_stub_section): Adjust
	lang_add_section call.
	* emultempl/mmo.em (mmo_place_orphan): Remove "file" param.  Adjust
	lang_add_section and lang_insert_orphan calls.
	* emultempl/pe.em (place_orphan): Likewise.  Access bfd via section
	owner.
	* emultempl/ppc64elf.em (ppc_add_stub_section): Adjust
	lang_add_section call.
	(build_toc_list): Access just_syms_flag via bfd usrdata.
	(build_section_lists): Likewise.
	* emultempl/xtensaelf.em (elf_xtensa_place_orphan): Remove "file"
	param.  Adjust place_orphan call.
	(ld_build_required_section_dependence): Access bfd via section owner.
This commit is contained in:
Alan Modra 2005-11-17 00:10:05 +00:00
parent a0fef31c45
commit 7b986e992e
15 changed files with 169 additions and 127 deletions

View file

@ -1313,8 +1313,7 @@ output_prev_sec_find (lang_output_section_statement_type *os)
}
lang_output_section_statement_type *
lang_insert_orphan (lang_input_statement_type *file,
asection *s,
lang_insert_orphan (asection *s,
const char *secname,
lang_output_section_statement_type *after,
struct orphan_save *place,
@ -1385,7 +1384,7 @@ lang_insert_orphan (lang_input_statement_type *file,
if (add_child == NULL)
add_child = &os->children;
lang_add_section (add_child, s, os, file);
lang_add_section (add_child, s, os);
lang_leave_output_section_statement (0, "*default*", NULL, NULL);
@ -1811,8 +1810,7 @@ section_already_linked (bfd *abfd, asection *sec, void *data)
void
lang_add_section (lang_statement_list_type *ptr,
asection *section,
lang_output_section_statement_type *output,
lang_input_statement_type *file)
lang_output_section_statement_type *output)
{
flagword flags = section->flags;
bfd_boolean discard;
@ -1870,7 +1868,6 @@ lang_add_section (lang_statement_list_type *ptr,
new = new_stat (lang_input_section, ptr);
new->section = section;
new->ifile = file;
section->output_section = output->bfd_section;
flags = section->flags;
@ -2046,15 +2043,14 @@ wild_sort (lang_wild_statement_type *wild,
fa = FALSE;
}
if (ls->ifile->the_bfd != NULL
&& bfd_my_archive (ls->ifile->the_bfd) != NULL)
if (bfd_my_archive (ls->section->owner) != NULL)
{
ln = bfd_get_filename (bfd_my_archive (ls->ifile->the_bfd));
ln = bfd_get_filename (bfd_my_archive (ls->section->owner));
la = TRUE;
}
else
{
ln = ls->ifile->filename;
ln = ls->section->owner->filename;
la = FALSE;
}
@ -2069,7 +2065,7 @@ wild_sort (lang_wild_statement_type *wild,
if (fa)
fn = file->filename;
if (la)
ln = ls->ifile->filename;
ln = ls->section->owner->filename;
i = strcmp (fn, ln);
if (i > 0)
@ -2115,8 +2111,7 @@ output_section_callback (lang_wild_statement_type *ptr,
if (before == NULL)
lang_add_section (&ptr->children, section,
(lang_output_section_statement_type *) output,
file);
(lang_output_section_statement_type *) output);
else
{
lang_statement_list_type list;
@ -2124,8 +2119,7 @@ output_section_callback (lang_wild_statement_type *ptr,
lang_list_init (&list);
lang_add_section (&list, section,
(lang_output_section_statement_type *) output,
file);
(lang_output_section_statement_type *) output);
/* If we are discarding the section, LIST.HEAD will
be NULL. */
@ -3903,7 +3897,8 @@ size_input_section
lang_input_section_type *is = &((*this_ptr)->input_section);
asection *i = is->section;
if (!is->ifile->just_syms_flag && (i->flags & SEC_EXCLUDE) == 0)
if (!((lang_input_statement_type *) i->owner->usrdata)->just_syms_flag
&& (i->flags & SEC_EXCLUDE) == 0)
{
unsigned int alignment_needed;
asection *o;
@ -5061,17 +5056,17 @@ lang_place_orphans (void)
}
lang_add_section (&default_common_section->children, s,
default_common_section, file);
default_common_section);
}
}
else if (ldemul_place_orphan (file, s))
else if (ldemul_place_orphan (s))
;
else
{
lang_output_section_statement_type *os;
os = lang_output_section_statement_lookup (s->name);
lang_add_section (&os->children, s, os, file);
lang_add_section (&os->children, s, os);
}
}
}