2005-10-23  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/1487
	* elf-bfd.h (_bfd_generic_init_private_section_data): New.
	(_bfd_elf_init_private_section_data): New.

	* elf.c (elf_fake_sections): Don't set SHF_GROUP for
	relocatable link.
	(bfd_elf_set_group_contents): Don't handle relocatable link
	specially.
	(assign_section_numbers): If it isn't called by assembler,
	use the output section of elf_linked_to_section for
	SHF_LINK_ORDER.
	(_bfd_elf_init_private_section_data): New.
	(_bfd_elf_copy_private_section_data): Call it.

	* libbfd-in.h (_bfd_generic_init_private_section_data): New.

	* libbfd.c (_bfd_generic_init_private_section_data): New.

	* targets.c (BFD_JUMP_TABLE_COPY): Add
	_bfd_generic_init_private_section_data.
	(bfd_init_private_section_data): Likewise.

	* bfd-in2.h: Regenerated.
	* libbfd.h: Likewise.

ld/

2005-10-23  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/1487
	* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Call
	bfd_match_sections_by_type to match section types.

	* ldlang.c (init_os): Take the input section. Call
	bfd_init_private_section_data if the input section isn't NULL.
	(exp_init_os): Pass NULL to init_os.
	(map_input_to_output_sections): Likewise.
	(lang_add_section): Pass the input section to init_os.

ld/testsuite/

2005-10-23  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/1487
	* ld-ia64/tlspic.rd: Updated.
This commit is contained in:
H.J. Lu
2005-10-24 01:40:58 +00:00
parent 167cadb67e
commit ccd2ec6a87
13 changed files with 190 additions and 130 deletions

View File

@ -1674,7 +1674,7 @@ sort_def_symbol (hash_entry, info)
/* Initialize an output section. */
static void
init_os (lang_output_section_statement_type *s)
init_os (lang_output_section_statement_type *s, asection *isec)
{
if (s->bfd_section != NULL)
return;
@ -1711,6 +1711,11 @@ init_os (lang_output_section_statement_type *s)
if (s->load_base != NULL)
exp_init_os (s->load_base);
if (isec)
bfd_init_private_section_data (isec->owner, isec,
output_bfd, s->bfd_section,
&link_info);
}
/* Make sure that all output sections mentioned in an expression are
@ -1756,7 +1761,7 @@ exp_init_os (etree_type *exp)
os = lang_output_section_find (exp->name.name);
if (os != NULL && os->bfd_section == NULL)
init_os (os);
init_os (os, NULL);
}
}
break;
@ -1833,7 +1838,7 @@ lang_add_section (lang_statement_list_type *ptr,
flagword flags;
if (output->bfd_section == NULL)
init_os (output);
init_os (output, section);
first = ! output->bfd_section->linker_has_input;
output->bfd_section->linker_has_input = 1;
@ -3099,7 +3104,7 @@ map_input_to_output_sections
are initialized. */
exp_init_os (s->data_statement.exp);
if (os != NULL && os->bfd_section == NULL)
init_os (os);
init_os (os, NULL);
/* The output section gets contents, and then we inspect for
any flags set in the input script which override any ALLOC. */
os->bfd_section->flags |= SEC_HAS_CONTENTS;
@ -3113,11 +3118,11 @@ map_input_to_output_sections
case lang_padding_statement_enum:
case lang_input_statement_enum:
if (os != NULL && os->bfd_section == NULL)
init_os (os);
init_os (os, NULL);
break;
case lang_assignment_statement_enum:
if (os != NULL && os->bfd_section == NULL)
init_os (os);
init_os (os, NULL);
/* Make sure that any sections mentioned in the assignment
are initialized. */
@ -3145,7 +3150,7 @@ map_input_to_output_sections
(s->address_statement.section_name));
if (aos->bfd_section == NULL)
init_os (aos);
init_os (aos, NULL);
aos->addr_tree = s->address_statement.address;
}
break;