summaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl@lucon.org>2006-10-15 14:22:13 +0000
committerH.J. Lu <hjl@lucon.org>2006-10-15 14:22:13 +0000
commitf1d3bd6b8bcfdf2ad497a3d50ddab6b55594ada3 (patch)
tree52ca04d2b62cdc02002249645b168982a89be703 /bfd/elf.c
parentc14b187b4bbc680affc47e9c6809e41f0acf4e5e (diff)
downloadbinutils-redhat-f1d3bd6b8bcfdf2ad497a3d50ddab6b55594ada3.tar.gz
2006-10-15 H.J. Lu <hongjiu.lu@intel.com>
PR ld/3314 * elf.c (assign_file_positions_for_non_load_sections): Don't page align empty SHF_ALLOC sections.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index ab23a190b9..010a9785b5 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -4665,11 +4665,12 @@ assign_file_positions_for_non_load_sections (bfd *abfd,
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)
+ abfd,
+ (hdr->bfd_section == NULL
+ ? "*unknown*"
+ : hdr->bfd_section->name)));
+ /* We don't need to page align empty sections. */
+ if ((abfd->flags & D_PAGED) != 0 && hdr->sh_size != 0)
off += vma_page_aligned_bias (hdr->sh_addr, off,
bed->maxpagesize);
else