diff options
author | Hans-Peter Nilsson <hp@axis.com> | 2009-07-31 02:25:56 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@axis.com> | 2009-07-31 02:25:56 +0000 |
commit | 080a1b9fb589cccd3ec63e91e871ef832c67abfd (patch) | |
tree | 82f8a62f94365675038b068951d0970fcda10880 | |
parent | 463bde6807db91a0485a41ab50535f062dd1574a (diff) | |
download | gdb-080a1b9fb589cccd3ec63e91e871ef832c67abfd.zip gdb-080a1b9fb589cccd3ec63e91e871ef832c67abfd.tar.gz gdb-080a1b9fb589cccd3ec63e91e871ef832c67abfd.tar.bz2 |
* linker.c (fix_syms): Consider SEC_LOAD when choosing section.
-rw-r--r-- | bfd/ChangeLog | 4 | ||||
-rw-r--r-- | bfd/linker.c | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 5a10493..88e61ec 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,7 @@ +2009-07-31 Hans-Peter Nilsson <hp@bitrange.com> + + * linker.c (fix_syms): Consider SEC_LOAD when choosing section. + 2009-07-30 Alan Modra <amodra@bigpond.net.au> * elf32-ppc.c (ppc_elf_check_relocs): Always set up sections diff --git a/bfd/linker.c b/bfd/linker.c index 66ec2fa..1c22beb 100644 --- a/bfd/linker.c +++ b/bfd/linker.c @@ -3149,10 +3149,16 @@ fix_syms (struct bfd_link_hash_entry *h, void *data) else if (op == NULL) op = op1; else if (((op1->flags ^ op->flags) - & (SEC_ALLOC | SEC_THREAD_LOCAL)) != 0) + & (SEC_ALLOC | SEC_THREAD_LOCAL | SEC_LOAD)) != 0) { if (((op->flags ^ s->flags) - & (SEC_ALLOC | SEC_THREAD_LOCAL)) != 0) + & (SEC_ALLOC | SEC_THREAD_LOCAL)) != 0 + /* We prefer to choose a loaded section. Section S + doesn't have SEC_LOAD set (it being excluded, that + part of the flag processing didn't happen) so we + can't compare that flag to those of OP and OP1. */ + || ((op1->flags & SEC_LOAD) != 0 + && (op->flags & SEC_LOAD) == 0)) op = op1; } else if (((op1->flags ^ op->flags) & SEC_READONLY) != 0) |