aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2005-10-24 01:40:58 +0000
committerH.J. Lu <hjl.tools@gmail.com>2005-10-24 01:40:58 +0000
commitccd2ec6a8718548c570e4dead571af5c6ba0e2e3 (patch)
tree874fe3c835590d942e7ee80207867794ed806ab4 /ld/ldlang.c
parent167cadb67eb4592e39a307973d0cb14a2137f964 (diff)
downloadgdb-ccd2ec6a8718548c570e4dead571af5c6ba0e2e3.zip
gdb-ccd2ec6a8718548c570e4dead571af5c6ba0e2e3.tar.gz
gdb-ccd2ec6a8718548c570e4dead571af5c6ba0e2e3.tar.bz2
bfd/
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.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index b82a7e5..7824d24 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -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;