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.
This commit is contained in:
Bob Wilson
2005-03-17 16:20:39 +00:00
parent 2115ce97f8
commit de7f8cc8e0
7 changed files with 70 additions and 4 deletions

View File

@ -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