summaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 5ccb36f514..7cf5108e47 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -1579,8 +1579,14 @@ lang_output_section_find_by_flags (const asection *sec,
}
flags ^= sec->flags;
if (!(flags & (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD
- | SEC_READONLY))
- && !(look->flags & (SEC_SMALL_DATA | SEC_THREAD_LOCAL)))
+ | SEC_READONLY | SEC_SMALL_DATA))
+ || (!(flags & (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD
+ | SEC_READONLY))
+ && !(look->flags & SEC_SMALL_DATA))
+ || (!(flags & (SEC_THREAD_LOCAL | SEC_ALLOC))
+ && (look->flags & SEC_THREAD_LOCAL)
+ && (!(flags & SEC_LOAD)
+ || (look->flags & SEC_LOAD))))
found = look;
}
}