summaryrefslogtreecommitdiff
path: root/bfd/linker.c
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2009-07-31 02:25:56 +0000
committerHans-Peter Nilsson <hp@axis.com>2009-07-31 02:25:56 +0000
commit24d36c60ce534eefed63463ae9c5497f7f210970 (patch)
tree3e2e6731f932f8823c6d299bab34fb36f7b72d09 /bfd/linker.c
parent8b3a47bd12039452154754cc63b1ac855dc4d125 (diff)
downloadbinutils-redhat-24d36c60ce534eefed63463ae9c5497f7f210970.tar.gz
* linker.c (fix_syms): Consider SEC_LOAD when choosing section.
Diffstat (limited to 'bfd/linker.c')
-rw-r--r--bfd/linker.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/bfd/linker.c b/bfd/linker.c
index 66ec2faa39..1c22beb990 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)