X-Git-Url: https://oss.titaniummirror.com/gitweb?p=msp430-binutils.git;a=blobdiff_plain;f=ld%2Femultempl%2Fbeos.em;h=370dbacd0b3273d2180bd25c055ea17f30fbeba3;hp=23d3849c5d70f27cd9caa15d9027c3e4cd7c4d4f;hb=88750007d7869f178f0ba528f41efd3b74c424cf;hpb=6df9443a374e2b81278c61b8afc0a1eef7db280b diff --git a/ld/emultempl/beos.em b/ld/emultempl/beos.em index 23d3849..370dbac 100644 --- a/ld/emultempl/beos.em +++ b/ld/emultempl/beos.em @@ -8,7 +8,7 @@ fi fragment <children); + push_stat_ptr (&abs_output_section->children); for (j = 0; init[j].ptr; j++) { @@ -367,7 +364,7 @@ gld_${EMULATION_NAME}_set_symbols (void) else abort(); } /* Restore the pointer. */ - stat_ptr = save; + pop_stat_ptr (); if (pe.FileAlignment > pe.SectionAlignment) @@ -382,13 +379,13 @@ gld_${EMULATION_NAME}_after_open (void) /* Pass the wacky PE command line options into the output bfd. FIXME: This should be done via a function, rather than by including an internal BFD header. */ - if (!coff_data(output_bfd)->pe) + if (!coff_data(link_info.output_bfd)->pe) { einfo ("%F%P: PE operations on non PE file.\n"); } - pe_data(output_bfd)->pe_opthdr = pe; - pe_data(output_bfd)->dll = init[DLLOFF].value; + pe_data(link_info.output_bfd)->pe_opthdr = pe; + pe_data(link_info.output_bfd)->dll = init[DLLOFF].value; } @@ -609,8 +606,6 @@ sort_sections (lang_statement_union_type *s) static void gld_${EMULATION_NAME}_before_allocation (void) { - extern lang_statement_list_type *stat_ptr; - #ifdef TARGET_IS_ppcpe /* Here we rummage through the found bfds to collect toc information */ { @@ -664,32 +659,31 @@ gld_${EMULATION_NAME}_before_allocation (void) but I'm leaving this here in case we want to enable it for sections which are not mentioned in the linker script. */ -static bfd_boolean -gld${EMULATION_NAME}_place_orphan (asection *s) +static lang_output_section_statement_type * +gld${EMULATION_NAME}_place_orphan (asection *s, + const char *secname, + int constraint) { - const char *secname; char *output_secname, *ps; lang_output_section_statement_type *os; lang_statement_union_type *l; if ((s->flags & SEC_ALLOC) == 0) - return FALSE; + return NULL; /* Don't process grouped sections unless doing a final link. If they're marked as COMDAT sections, we don't want .text\$foo to end up in .text and then have .text disappear because it's marked link-once-discard. */ if (link_info.relocatable) - return FALSE; - - secname = bfd_get_section_name (s->owner, s); + return NULL; /* 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); if (strchr (secname + 1, '\$') == NULL) - return FALSE; + return NULL; /* Look up the output section. The Microsoft specs say sections names in image files never contain a '\$'. Fortunately, lang_..._lookup creates @@ -697,7 +691,7 @@ gld${EMULATION_NAME}_place_orphan (asection *s) output_secname = xstrdup (secname); ps = strchr (output_secname + 1, '\$'); *ps = 0; - os = lang_output_section_statement_lookup (output_secname); + os = lang_output_section_statement_lookup (output_secname, constraint, TRUE); /* Find the '\$' wild statement for this section. We currently require the linker script to explicitly mention "*(.foo\$)". @@ -727,7 +721,7 @@ gld${EMULATION_NAME}_place_orphan (asection *s) sort_sections. */ lang_add_section (&l->wild_statement.children, s, os); - return TRUE; + return os; } static char *