This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
ld in CVS is broken on Linux/ia32
- To: alan at linuxcare dot com dot au
- Subject: ld in CVS is broken on Linux/ia32
- From: "H . J . Lu" <hjl at valinux dot com>
- Date: Sun, 16 Apr 2000 11:50:54 -0700
- Cc: binutils at sourceware dot cygnus dot com, Ian Lance Taylor <ian at zembu dot com>
This patch causes "make check" to fail ld bootstrap tests on
Linux/ia32. Backing it out passes the ld bootstrap tests.
--
H.J. Lu (hjl@gnu.org)
---
2000-04-14 Alan Modra <alan@linuxcare.com.au>
* emultempl/elf32.em (gld${EMULATION_NAME}_place_section): Process
~SEC_ALLOC sections too. Init start address of debug sections.
Index: emultempl/elf32.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/elf32.em,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -p -r1.13 -r1.14
--- emultempl/elf32.em 2000/04/12 02:43:37 1.13
+++ emultempl/elf32.em 2000/04/14 01:58:29 1.14
@@ -895,9 +895,6 @@ gld${EMULATION_NAME}_place_orphan (file,
const char *outsecname;
lang_output_section_statement_type *os;
- if ((s->flags & SEC_ALLOC) == 0)
- return false;
-
/* Look through the script to see where to place this section. */
hold_section = s;
hold_use = NULL;
@@ -951,7 +948,7 @@ gld${EMULATION_NAME}_place_orphan (file,
&& hold_text.os != NULL)
place = &hold_text;
else
- return false;
+ place = NULL;
/* Choose a unique name for the section. This will be needed if the
same section name appears in the input file with different
@@ -983,7 +980,7 @@ gld${EMULATION_NAME}_place_orphan (file,
if (snew == NULL)
einfo ("%P%F: output format %s cannot represent section called %s\n",
output_bfd->xvec->name, outsecname);
- if (place->os->bfd_section != NULL)
+ if (place != NULL && place->os->bfd_section != NULL)
{
/* Unlink it first. */
for (pps = &output_bfd->sections; *pps != snew; pps = &(*pps)->next)
@@ -1018,10 +1015,10 @@ gld${EMULATION_NAME}_place_orphan (file,
<< s->alignment_power))));
}
- if (! link_info.relocateable)
- address = NULL;
- else
+ if (link_info.relocateable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
address = exp_intop ((bfd_vma) 0);
+ else
+ address = NULL;
lang_enter_output_section_statement (outsecname, address, 0,
(bfd_vma) 0,
@@ -1047,20 +1044,22 @@ gld${EMULATION_NAME}_place_orphan (file,
exp_nameop (NAME, ".")));
}
- if (! place->stmt)
+ if (place != NULL)
{
- /* Put the new statement list right at the head. */
- *add.tail = place->os->header.next;
- place->os->header.next = add.head;
- }
- else
- {
- /* Put it after the last orphan statement we added. */
- *add.tail = *place->stmt;
- *place->stmt = add.head;
+ if (! place->stmt)
+ {
+ /* Put the new statement list right at the head. */
+ *add.tail = place->os->header.next;
+ place->os->header.next = add.head;
+ }
+ else
+ {
+ /* Put it after the last orphan statement we added. */
+ *add.tail = *place->stmt;
+ *place->stmt = add.head;
+ }
+ place->stmt = add.tail; /* Save the end of this list. */
}
- place->stmt = add.tail; /* Save the end of this list. */
-
stat_ptr = old;
return true;