diff options
author | Alan Modra <amodra@gmail.com> | 2005-07-04 10:30:09 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2005-07-04 10:30:09 +0000 |
commit | 540b09cb7df7c3b34dd5dd9d8e5e6fea5d482baf (patch) | |
tree | 5c3536b781f344a045bbe7209fb70ea299857e4d /bfd | |
parent | b4ad899f0b73f79964c2278b8b044b07aa7f2215 (diff) | |
download | gdb-540b09cb7df7c3b34dd5dd9d8e5e6fea5d482baf.zip gdb-540b09cb7df7c3b34dd5dd9d8e5e6fea5d482baf.tar.gz gdb-540b09cb7df7c3b34dd5dd9d8e5e6fea5d482baf.tar.bz2 |
PR 1042
* elf.c (assign_file_positions_for_segments): Remove excluded
sections from the segment map.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elf.c | 10 |
2 files changed, 11 insertions, 5 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 388c568..87d7ee4 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,11 @@ 2005-07-04 Alan Modra <amodra@bigpond.net.au> + PR 1042 + * elf.c (assign_file_positions_for_segments): Remove excluded + sections from the segment map. + +2005-07-04 Alan Modra <amodra@bigpond.net.au> + PR 1004 * elf-bfd.h (struct elf_backend_data): Add get_sec_type_attr. Delete special_sections. @@ -4044,7 +4044,8 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) { /* The placement algorithm assumes that non allocated sections are not in PT_LOAD segments. We ensure this here by removing such - sections from the segment map. */ + sections from the segment map. We also remove excluded + sections. */ for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) @@ -4052,13 +4053,12 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) unsigned int new_count; unsigned int i; - if (m->p_type != PT_LOAD) - continue; - new_count = 0; for (i = 0; i < m->count; i ++) { - if ((m->sections[i]->flags & SEC_ALLOC) != 0) + if ((m->sections[i]->flags & SEC_EXCLUDE) == 0 + && ((m->sections[i]->flags & SEC_ALLOC) != 0 + || m->p_type != PT_LOAD)) { if (i != new_count) m->sections[new_count] = m->sections[i]; |