summaryrefslogtreecommitdiffstats
path: root/contrib/binutils/bfd
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2010-10-25 19:43:22 +0000
committerdim <dim@FreeBSD.org>2010-10-25 19:43:22 +0000
commitb985ffce133dbdaa89aeb0cca7488146762ccb4e (patch)
treeae4ea5dc92334339c2cca917a49b3894a21e9391 /contrib/binutils/bfd
parent6582686305de16b3784e4e34cf5ef47268efc9c0 (diff)
downloadFreeBSD-src-b985ffce133dbdaa89aeb0cca7488146762ccb4e.zip
FreeBSD-src-b985ffce133dbdaa89aeb0cca7488146762ccb4e.tar.gz
Apply commit f6c8fecc6fe3d5532691867a7f27820bb1c426a9 from upstream
(still under GPLv2 at that time): Author: H.J. Lu <hjl@lucon.org> Date: Wed Sep 27 04:18:16 2006 +0000 PR ld/3223 PR ld/3267 * bfd/elf.c (assign_file_positions_for_non_load_sections): Don't warn zero size allocated sections. * ld/ldlang.h (lang_output_section_statement_type): Add section_relative_symbol. * ld/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. This prevents warnings like the following during stripping of debug info from kernel modules on i386: ===> zlib (all) ... objcopy --only-keep-debug zlib.ko.debug zlib.ko.symbols objcopy --strip-debug --add-gnu-debuglink=zlib.ko.symbols zlib.ko.debug zlib.ko BFD: zlib.ko: warning: allocated section `.plt' not in segment BFD: zlib.ko: warning: allocated section `.got' not in segment
Diffstat (limited to 'contrib/binutils/bfd')
-rw-r--r--contrib/binutils/bfd/elf.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/contrib/binutils/bfd/elf.c b/contrib/binutils/bfd/elf.c
index 6888880..c2ee684 100644
--- a/contrib/binutils/bfd/elf.c
+++ b/contrib/binutils/bfd/elf.c
@@ -4787,12 +4787,13 @@ assign_file_positions_except_relocs (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);
OpenPOWER on IntegriCloud