This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Revert readelf sorted PT_LOAD header check
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Cc: Nick Clifton <nickc at redhat dot com>
- Date: Wed, 30 Nov 2016 17:16:40 +1030
- Subject: Revert readelf sorted PT_LOAD header check
- Authentication-results: sourceware.org; auth=none
This fixes a couple of test failures. OK Nick?
FAIL: ld-elf/loadaddr1
FAIL: PHDRS headers 3a
Both with the following ld.log
exited abnormally with 0, output:readelf: Error: LOAD segments must be sorted in order of increasing VirtAddr
PR ld/20815
* readelf.c (process_program_headers): Don't check PT_LOAD p_vaddr.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 347b6b9..09a3a11 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -4909,9 +4909,6 @@ process_program_headers (FILE * file)
switch (segment->p_type)
{
case PT_LOAD:
- if (previous_load
- && previous_load->p_vaddr > segment->p_vaddr)
- error (_("LOAD segments must be sorted in order of increasing VirtAddr\n"));
if (segment->p_memsz < segment->p_filesz)
error (_("the segment's file size is larger than its memory size\n"));
previous_load = segment;
--
Alan Modra
Australia Development Lab, IBM