diff options
author | Alan Modra <amodra@gmail.com> | 2000-04-14 01:58:29 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2000-04-14 01:58:29 +0000 |
commit | 01cc8ff856f0530ce7333a7bdac283c51b0e4f5e (patch) | |
tree | 5c7ff64ebfc68b057933fd51bdc46028bbacb3b1 /ld/emultempl/elf32.em | |
parent | 4ab10e93d6f65abac0857f26c8b1431cc5f7f5f9 (diff) | |
download | gdb-01cc8ff856f0530ce7333a7bdac283c51b0e4f5e.zip gdb-01cc8ff856f0530ce7333a7bdac283c51b0e4f5e.tar.gz gdb-01cc8ff856f0530ce7333a7bdac283c51b0e4f5e.tar.bz2 |
Zero start address of orphan ~(SEC_LOAD | SEC_ALLOC) sections.
Diffstat (limited to 'ld/emultempl/elf32.em')
-rw-r--r-- | ld/emultempl/elf32.em | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index a25f211..2489779 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -895,9 +895,6 @@ gld${EMULATION_NAME}_place_orphan (file, s) 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, s) && 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, s) 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) << 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, s) 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; |