From 325ba6fb34be799c885fad9287d883e86b835c84 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sat, 17 Feb 2018 09:21:17 +1030 Subject: Ignore degenerate PT_LOAD segments Fixes a failure triggered by -z separate-code. p_memsz is tested rather than p_filesz for objcopy --only-keep-debug where p_filesz is set to zero. PR 22845 * elf.c (assign_file_positions_for_non_load_sections): Ignore degenerate zero size PT_LOAD segments when finding one overlapping the PT_GNU_RELRO segment. --- bfd/elf.c | 1 + 1 file changed, 1 insertion(+) (limited to 'bfd/elf.c') diff --git a/bfd/elf.c b/bfd/elf.c index 397fa62..b069b59 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -5897,6 +5897,7 @@ assign_file_positions_for_non_load_sections (bfd *abfd, lm = lm->next, lp++) { if (lp->p_type == PT_LOAD + && lp->p_memsz != 0 && lm->count != 0 && lm->sections[lm->count - 1]->vma >= start && lm->sections[0]->vma < end) -- cgit v1.1