summaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index bf05ae0a80..8df38ee379 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -6226,12 +6226,13 @@ copy_elf_program_header (bfd *ibfd, bfd *obfd)
if (ELF_SECTION_IN_SEGMENT (this_hdr, segment))
{
map->sections[isec++] = section->output_section;
- if (section->lma < lowest_section->lma)
- lowest_section = section;
if ((section->flags & SEC_ALLOC) != 0)
{
bfd_vma seg_off;
+ if (section->lma < lowest_section->lma)
+ lowest_section = section;
+
/* Section lmas are set up from PT_LOAD header
p_paddr in _bfd_elf_make_section_from_shdr.
If this header has a p_paddr that disagrees