This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ld is broken for beos.
On Sat, Aug 04, 2001 at 10:09:23AM +0930, Alan Modra wrote:
> On Fri, Aug 03, 2001 at 12:04:37PM -0700, H . J . Lu wrote:
> > http://sources.redhat.com/ml/binutils/2001-08/msg00045.html
> >
> > changed lang_wild_statement_type which breaks beos.em. Do
>
> beos? Who uses that anyway? :) Oh well, looks like I have some
> fixing to do.
I committed the following. Can't actually test it, as I don't have
access to beos.
ld/ChangeLog
* emultempl/beos.em (sort_sections): Modify for 2001-08-03 change,
ie. iterate over wild_statement.section_list.
(gld${EMULATION_NAME}_place_orphan): Likewise.
--
Alan Modra
Index: ld/emultempl/beos.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/beos.em,v
retrieving revision 1.10
diff -u -p -w -r1.10 beos.em
--- beos.em 2001/08/03 19:19:42 1.10
+++ beos.em 2001/08/04 01:14:38
@@ -595,10 +595,13 @@ sort_sections (s)
case lang_wild_statement_enum:
{
lang_statement_union_type **p = &s->wild_statement.children.head;
+ struct wildcard_list *sec;
+ for (sec = s->wild_statement.section_list; sec; sec = sec->next)
+ {
/* Is this the .idata section? */
- if (s->wild_statement.section_name != NULL
- && strncmp (s->wild_statement.section_name, ".idata", 6) == 0)
+ if (sec->spec.name != NULL
+ && strncmp (sec->spec.name, ".idata", 6) == 0)
{
/* Sort the children. We want to sort any objects in
the same archive. In order to handle the case of
@@ -619,11 +622,13 @@ sort_sections (s)
int count;
for (end = start, count = 0;
- end && end->header.type == lang_input_section_enum;
+ end && (end->header.type
+ == lang_input_section_enum);
end = end->next)
count++;
- p = sort_sections_1 (p, end, count, sort_by_file_name);
+ p = sort_sections_1 (p, end, count,
+ sort_by_file_name);
}
}
break;
@@ -635,9 +640,9 @@ sort_sections (s)
character (not sure if this is really useful, but it
allows explicitly mentioning some \$ sections and letting
the linker handle the rest). */
- if (s->wild_statement.section_name != NULL)
+ if (sec->spec.name != NULL)
{
- char *q = strchr (s->wild_statement.section_name, '\$');
+ char *q = strchr (sec->spec.name, '\$');
if (q != NULL
&& (q[1] == '\0'
@@ -652,11 +657,13 @@ sort_sections (s)
abort ();
count++;
}
- (void) sort_sections_1 (p, end, count, sort_by_section_name);
+ (void) sort_sections_1 (p, end, count,
+ sort_by_section_name);
}
break;
}
}
+ }
break;
default:
break;
@@ -765,10 +772,15 @@ gld${EMULATION_NAME}_place_orphan (file,
ps[0] = '\$';
ps[1] = 0;
for (l = os->children.head; l; l = l->next)
+ if (l->header.type == lang_wild_statement_enum)
{
- if (l->header.type == lang_wild_statement_enum
- && strcmp (l->wild_statement.section_name, output_secname) == 0)
+ struct wildcard_list *sec;
+
+ for (sec = l->wild_statement.section_list; sec; sec = sec->next)
+ if (sec->spec.name && strcmp (sec->spec.name, output_secname) == 0)
break;
+ if (sec)
+ break;
}
ps[0] = 0;
if (l == NULL)
@@ -778,11 +790,20 @@ gld${EMULATION_NAME}_place_orphan (file,
should one decide to not require *(.foo\$) to appear in the linker
script. */
{
- lang_wild_statement_type *new = new_stat (lang_wild_statement,
- &os->children);
- new->section_name = xmalloc (strlen (output_secname) + 2);
- sprintf (new->section_name, "%s\$", output_secname);
+ lang_wild_statement_type *new;
+ struct wildcard_list *tmp;
+
+ tmp = (struct wildcard_list *) xmalloc (sizeof *tmp);
+ tmp->next = NULL;
+ tmp->spec.name = xmalloc (strlen (output_secname) + 2);
+ sprintf (tmp->spec.name, "%s\$", output_secname);
+ tmp->spec.exclude_name_list = NULL;
+ tmp->sorted = false;
+ new = new_stat (lang_wild_statement, &os->children);
new->filename = NULL;
+ new->filenames_sorted = false;
+ new->section_list = tmp;
+ new->keep_sections = false;
lang_list_init (&new->children);
l = new;
}