+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.
+ * emultempl/armelf.em (gld${EMULATION_NAME}_place_section): Ditto.
+ * emultempl/pe.em (gld${EMULATION_NAME}_place_section): Ditto.
+ Also set all relocateable section start addresses.
+
2000-04-13 Geoff Keating <geoffk@cygnus.com>
* scripttempl/elf.sc: Add support for .sbss2 and .sdata2 sections.
* ldgram.y: Handle LMA region syntax.
* ld.texinfo (Output Section Description): Describe LMA region usage.
* emultempl/armelf.em (gld$place_orphan): Add default value for
- lma region in call to lang_leave_output_statement.
+ lma region in call to lang_leave_output_section_statement.
* emultempl/elf32.em (gld$place_orphan): Add default value for
- lma region in call to lang_leave_output_statement.
+ lma region in call to lang_leave_output_section_statement.
* emultempl/pe.em (gld$place_orphan): Add default value for
- lma region in call to lang_leave_output_statement.
+ lma region in call to lang_leave_output_section_statement.
2000-02-04 Timothy Wall <twall@redhat.com>
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;
&& 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
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)
<< 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,
exp_nameop (NAME, ".")));
}
- 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
+ if (place != NULL)
{
- /* 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;
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;
&& 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
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)
<< 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,
exp_nameop (NAME, ".")));
}
- 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
+ if (place != NULL)
{
- /* 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;
const char *secname;
char *dollar = NULL;
- if ((s->flags & SEC_ALLOC) == 0)
- return false;
-
secname = bfd_get_section_name (s->owner, s);
/* Look through the script to see where to place this section. */
stat_ptr = &add;
lang_list_init (stat_ptr);
- if (link_info.relocateable)
- address = NULL;
+ if (link_info.relocateable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
+ address = exp_intop ((bfd_vma) 0);
else
{
/* All sections in an executable must be aligned to a page