* 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

@ -218,43 +218,46 @@ build_link_order (lang_statement_union_type *statement)
break;
case lang_input_section_enum:
/* Create a new link_order in the output section with this
attached */
if (!statement->input_section.ifile->just_syms_flag
&& (statement->input_section.section->flags & SEC_EXCLUDE) == 0)
{
asection *i = statement->input_section.section;
asection *output_section = i->output_section;
{
/* Create a new link_order in the output section with this
attached */
asection *i = statement->input_section.section;
ASSERT (output_section->owner == output_bfd);
if (!((lang_input_statement_type *) i->owner->usrdata)->just_syms_flag
&& (i->flags & SEC_EXCLUDE) == 0)
{
asection *output_section = i->output_section;
if ((output_section->flags & SEC_HAS_CONTENTS) != 0
|| ((output_section->flags & SEC_LOAD) != 0
&& (output_section->flags & SEC_THREAD_LOCAL)))
{
struct bfd_link_order *link_order;
ASSERT (output_section->owner == output_bfd);
link_order = bfd_new_link_order (output_bfd, output_section);
if ((output_section->flags & SEC_HAS_CONTENTS) != 0
|| ((output_section->flags & SEC_LOAD) != 0
&& (output_section->flags & SEC_THREAD_LOCAL)))
{
struct bfd_link_order *link_order;
if (i->flags & SEC_NEVER_LOAD)
{
/* We've got a never load section inside one which
is going to be output, we'll change it into a
fill. */
link_order->type = bfd_data_link_order;
link_order->u.data.contents = (unsigned char *) "";
link_order->u.data.size = 1;
}
else
{
link_order->type = bfd_indirect_link_order;
link_order->u.indirect.section = i;
ASSERT (i->output_section == output_section);
}
link_order->size = i->size;
link_order->offset = i->output_offset;
}
}
link_order = bfd_new_link_order (output_bfd, output_section);
if (i->flags & SEC_NEVER_LOAD)
{
/* We've got a never load section inside one which
is going to be output, we'll change it into a
fill. */
link_order->type = bfd_data_link_order;
link_order->u.data.contents = (unsigned char *) "";
link_order->u.data.size = 1;
}
else
{
link_order->type = bfd_indirect_link_order;
link_order->u.indirect.section = i;
ASSERT (i->output_section == output_section);
}
link_order->size = i->size;
link_order->offset = i->output_offset;
}
}
}
break;
case lang_padding_statement_enum: