diff options
author | Bob Wilson <bob.wilson@acm.org> | 2005-03-17 16:20:39 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@acm.org> | 2005-03-17 16:20:39 +0000 |
commit | de7f8cc8e0f573fc75e53373251d58309d6e6c84 (patch) | |
tree | 5c57735992f1f1113d9bd7f7986046a6a6b5b4d8 /ld/ldlang.c | |
parent | 2115ce97f835621403b769545f7c95153d9e0477 (diff) | |
download | gdb-de7f8cc8e0f573fc75e53373251d58309d6e6c84.zip gdb-de7f8cc8e0f573fc75e53373251d58309d6e6c84.tar.gz gdb-de7f8cc8e0f573fc75e53373251d58309d6e6c84.tar.bz2 |
ld/ChangeLog:
* ldlang.c (IGNORE_SECTION): Remove check for zero size.
(lang_check_section_addresses): Ignore zero size sections here.
ld/testsuite/ChangeLog:
* ld-scripts/empty-orphan.d, ld-scripts/empty-orphan.exp,
ld-scripts/empty-orphan.s, ld-scripts/emtpy-orphan.t: New test.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r-- | ld/ldlang.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c index 72545c2..dc805a3 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -3300,8 +3300,7 @@ size_input_section ((s->flags & SEC_NEVER_LOAD) != 0 \ || (s->flags & SEC_ALLOC) == 0 \ || ((s->flags & SEC_THREAD_LOCAL) != 0 \ - && (s->flags & SEC_LOAD) == 0) \ - || s->size == 0) + && (s->flags & SEC_LOAD) == 0)) /* Check to see if any allocated sections overlap with other allocated sections. This can happen if a linker script specifies the output @@ -3318,7 +3317,7 @@ lang_check_section_addresses (void) asection *os; /* Ignore sections which are not loaded or which have no contents. */ - if (IGNORE_SECTION (s)) + if (IGNORE_SECTION (s) || s->size == 0) continue; /* Once we reach section 's' stop our seach. This prevents two @@ -3332,7 +3331,7 @@ lang_check_section_addresses (void) bfd_vma os_end; /* Only consider loadable sections with real contents. */ - if (IGNORE_SECTION (os)) + if (IGNORE_SECTION (os) || os->size == 0) continue; /* We must check the sections' LMA addresses not their |