summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2019-01-07 17:47:25 +0000
committerkettenis <kettenis@openbsd.org>2019-01-07 17:47:25 +0000
commitdf170e642d0ca2a4b013ec9cf331133355b86440 (patch)
tree95240f32992003f55e090dde9761a97dd546700a
parentUse the `iface' argument from the *attach() function instead of calling (diff)
downloadwireguard-openbsd-df170e642d0ca2a4b013ec9cf331133355b86440.tar.xz
wireguard-openbsd-df170e642d0ca2a4b013ec9cf331133355b86440.zip
Don't print "allocated section '.foobar' not in segment" warning for
zero-sized sections. ok deraadt@, guenther@
-rw-r--r--gnu/usr.bin/binutils-2.17/bfd/elf.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/gnu/usr.bin/binutils-2.17/bfd/elf.c b/gnu/usr.bin/binutils-2.17/bfd/elf.c
index ce4e468f689..f9e750b4f7d 100644
--- a/gnu/usr.bin/binutils-2.17/bfd/elf.c
+++ b/gnu/usr.bin/binutils-2.17/bfd/elf.c
@@ -4879,12 +4879,15 @@ 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->bfd_section->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);