From 49c13adb16c432e9d04770f7c6b8348e31bb1df1 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 27 Sep 2006 04:18:16 +0000 Subject: bfd/ 2006-09-26 H.J. Lu PR ld/3223 PR ld/3267 * elf.c (assign_file_positions_for_non_load_sections): Don't warn zero size allocated sections. ld/ 2006-09-26 H.J. Lu PR ld/3223 PR ld/3267 * ld.texinfo: Updated Output Section Discarding. * ldlang.h (lang_output_section_statement_type): Add section_relative_symbol. * ldlang.c (strip_excluded_output_sections): Don't strip a section with a symbol relative to it. (lang_size_sections_1): Mark if an output section has a symbol symbol relative to it. ld/testsuite/ 2006-09-26 H.J. Lu PR ld/3223 PR ld/3267 * ld-scripts/empty-address-1.d: New file. * ld-scripts/empty-address-1.s: Likewise. * ld-scripts/empty-address-1.t: Likewise. * ld-scripts/empty-address-2.s: Likewise. * ld-scripts/empty-address-2a.d: Likewise. * ld-scripts/empty-address-2a.t: Likewise. * ld-scripts/empty-address-2b.d: Likewise. * ld-scripts/empty-address-2b.t: Likewise. * ld-scripts/empty-address-3.s: Likewise. * ld-scripts/empty-address-3a.d: Likewise. * ld-scripts/empty-address-3a.t: Likewise. * ld-scripts/empty-address-3b.d: Likewise. * ld-scripts/empty-address-3b.t: Likewise. * ld-scripts/empty-address-3c.d: Likewise. * ld-scripts/empty-address-3c.t: Likewise. * ld-scripts/empty-address.exp: Likewise. --- bfd/ChangeLog | 7 +++++++ bfd/elf.c | 13 +++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'bfd') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index e8bf78b..a241894 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2006-09-26 H.J. Lu + + PR ld/3223 + PR ld/3267 + * elf.c (assign_file_positions_for_non_load_sections): Don't + warn zero size allocated sections. + 2006-09-27 Alan Modra * elf32-score.c (_bfd_score_elf_relocate_section): Move assignment diff --git a/bfd/elf.c b/bfd/elf.c index 87c3cc7..ab23a19 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -4662,12 +4662,13 @@ assign_file_positions_for_non_load_sections (bfd *abfd, hdr->sh_offset = hdr->bfd_section->filepos; else if ((hdr->sh_flags & SHF_ALLOC) != 0) { - ((*_bfd_error_handler) - (_("%B: warning: allocated section `%s' not in segment"), - abfd, - (hdr->bfd_section == NULL - ? "*unknown*" - : hdr->bfd_section->name))); + if (hdr->sh_size != 0) + ((*_bfd_error_handler) + (_("%B: warning: allocated section `%s' not in segment"), + abfd, + (hdr->bfd_section == NULL + ? "*unknown*" + : hdr->bfd_section->name))); if ((abfd->flags & D_PAGED) != 0) off += vma_page_aligned_bias (hdr->sh_addr, off, bed->maxpagesize); -- cgit v1.1