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/armelf.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/armelf.em')
-rw-r--r-- | ld/emultempl/armelf.em | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em index c66d43f..e5f1514 100644 --- a/ld/emultempl/armelf.em +++ b/ld/emultempl/armelf.em @@ -813,9 +813,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; @@ -869,7 +866,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 @@ -901,7 +898,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) @@ -936,10 +933,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, @@ -965,20 +962,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; |