X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=ld%2Femultempl%2Fbeos.em;h=2c3e5e5370d039c8ff69e116dd7a134327625908;hb=9b538ba71fc7dbab65371e3e4e5f7e093ff25023;hp=8b7d5a53fa59f800379743ece59bd1b11b7228cd;hpb=5c3261b0e834647cf9eb555320e20871b7854f98;p=binutils-gdb.git diff --git a/ld/emultempl/beos.em b/ld/emultempl/beos.em index 8b7d5a53fa5..2c3e5e5370d 100644 --- a/ld/emultempl/beos.em +++ b/ld/emultempl/beos.em @@ -7,7 +7,7 @@ else fi fragment < pe.SectionAlignment) { - einfo (_("%P: warning, file alignment > section alignment.\n")); + einfo (_("%P: warning, file alignment > section alignment\n")); } } @@ -380,7 +381,7 @@ gld_${EMULATION_NAME}_after_open (void) including an internal BFD header. */ if (!coff_data(link_info.output_bfd)->pe) { - einfo (_("%F%P: PE operations on non PE file.\n")); + einfo (_("%F%P: PE operations on non PE file\n")); } pe_data(link_info.output_bfd)->pe_opthdr = pe; @@ -393,17 +394,18 @@ gld_${EMULATION_NAME}_after_open (void) static int sort_by_file_name (const void *a, const void *b) { - const lang_statement_union_type *const *ra = a; - const lang_statement_union_type *const *rb = b; + const lang_input_section_type *const *ra = a; + const lang_input_section_type *const *rb = b; + asection *sa = (*ra)->section; + asection *sb = (*rb)->section; int i, a_sec, b_sec; - i = filename_cmp ((*ra)->input_section.section->owner->my_archive->filename, - (*rb)->input_section.section->owner->my_archive->filename); + i = filename_cmp (sa->owner->my_archive->filename, + sb->owner->my_archive->filename); if (i != 0) return i; - i = filename_cmp ((*ra)->input_section.section->owner->filename, - (*rb)->input_section.section->owner->filename); + i = filename_cmp (sa->owner->filename, sb->owner->filename); if (i != 0) return i; /* the tail idata4/5 are the only ones without relocs to an @@ -412,36 +414,29 @@ sort_by_file_name (const void *a, const void *b) and HNT properly. if no reloc this one is import by ordinal so we have to sort by section contents */ - if ((*ra)->input_section.section->reloc_count - + (*rb)->input_section.section->reloc_count) + if (sa->reloc_count + sb->reloc_count != 0) { - i = ((*ra)->input_section.section->reloc_count - > (*rb)->input_section.section->reloc_count) ? -1 : 0; + i = sa->reloc_count > sb->reloc_count ? -1 : 0; if (i != 0) return i; - return ((*ra)->input_section.section->reloc_count - > (*rb)->input_section.section->reloc_count) ? 0 : 1; + return sa->reloc_count > sb->reloc_count ? 0 : 1; } else { /* don't sort .idata$6 or .idata$7 FIXME dlltool eliminate .idata$7 */ - if ((strcmp ((*ra)->input_section.section->name, ".idata$6") == 0)) + if ((strcmp (sa->name, ".idata$6") == 0)) return 0; - if (!bfd_get_section_contents ((*ra)->input_section.section->owner, - (*ra)->input_section.section, &a_sec, - (file_ptr) 0, - (bfd_size_type) sizeof(a_sec))) - einfo (_("%F%B: Can't read contents of section .idata: %E\n"), - (*ra)->input_section.section->owner); + if (!bfd_get_section_contents (sa->owner, sa, &a_sec, (file_ptr) 0, + (bfd_size_type) sizeof (a_sec))) + einfo (_("%F%P: %pB: can't read contents of section .idata: %E\n"), + sa->owner); - if (!bfd_get_section_contents ((*rb)->input_section.section->owner, - (*rb)->input_section.section, &b_sec, - (file_ptr) 0, - (bfd_size_type) sizeof(b_sec))) - einfo (_("%F%B: Can't read contents of section .idata: %E\n"), - (*rb)->input_section.section->owner); + if (!bfd_get_section_contents (sb->owner, sb, &b_sec, (file_ptr) 0, + (bfd_size_type) sizeof (b_sec))) + einfo (_("%F%P: %pB: can't read contents of section .idata: %E\n"), + sb->owner); i = a_sec < b_sec ? -1 : 0; if (i != 0) @@ -454,18 +449,19 @@ sort_by_file_name (const void *a, const void *b) static int sort_by_section_name (const void *a, const void *b) { - const lang_statement_union_type *const *ra = a; - const lang_statement_union_type *const *rb = b; + const lang_input_section_type *const *ra = a; + const lang_input_section_type *const *rb = b; + const char *sna = (*ra)->section->name; + const char *snb = (*rb)->section->name; int i; - i = strcmp ((*ra)->input_section.section->name, - (*rb)->input_section.section->name); + i = strcmp (sna, snb); /* This is a hack to make .stab and .stabstr last, so we don't have to fix strip/objcopy for .reloc sections. FIXME stripping images with a .rsrc section still needs to be fixed. */ if (i != 0) { - if ((CONST_STRNEQ ((*ra)->input_section.section->name, ".stab")) - && (! CONST_STRNEQ ((*rb)->input_section.section->name, ".stab"))) + if ((CONST_STRNEQ (sna, ".stab")) + && (!CONST_STRNEQ (snb, ".stab"))) return 1; } return i; @@ -618,7 +614,8 @@ gld_${EMULATION_NAME}_before_allocation (void) { if (!ppc_process_before_allocation(is->the_bfd, &link_info)) { - einfo (_("Errors encountered processing file %s\n"), is->filename); + einfo (_("%P: errors encountered processing file %s\n"), + is->filename); } } } @@ -638,7 +635,8 @@ gld_${EMULATION_NAME}_before_allocation (void) { if (!arm_process_before_allocation (is->the_bfd, & link_info)) { - einfo (_("Errors encountered processing file %s"), is->filename); + einfo (_("%P: errors encountered processing file %s\n"), + is->filename); } } } @@ -686,7 +684,7 @@ gld${EMULATION_NAME}_place_orphan (asection *s, /* Everything from the '\$' on gets deleted so don't allow '\$' as the first character. */ if (*secname == '\$') - einfo (_("%P%F: section %s has '\$' as first character\n"), secname); + einfo (_("%F%P: section %s has '\$' as first character\n"), secname); if (strchr (secname + 1, '\$') == NULL) return NULL; @@ -718,7 +716,7 @@ gld${EMULATION_NAME}_place_orphan (asection *s, } ps[0] = 0; if (l == NULL) - einfo (_("%P%F: *(%s\$) missing from linker script\n"), output_secname); + einfo (_("%F%P: *(%s\$) missing from linker script\n"), output_secname); /* Link the input section in and we're done for now. The sections still have to be sorted, but that has to wait until @@ -765,6 +763,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = after_parse_default, gld_${EMULATION_NAME}_after_open, after_check_relocs_default, + before_place_orphans_default, after_allocation_default, set_output_arch_default, ldemul_default_target, @@ -785,6 +784,8 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = NULL, /* recognized file */ NULL, /* find_potential_libraries */ NULL, /* new_vers_pattern */ - NULL /* extra_map_file_text */ + NULL, /* extra_map_file_text */ + ${LDEMUL_EMIT_CTF_EARLY-NULL}, + ${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL} }; EOF