bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/20815] throw errors for invalid load segment


From: ma.jiang at zte dot com.cn
Subject: [Bug ld/20815] throw errors for invalid load segment
Date: Wed, 16 Nov 2016 11:08:00 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=20815

--- Comment #6 from ma.jiang at zte dot com.cn ---
Hi Nick,
  Thanks for the reply.
  This is a tricky problem.
  First of all , The elf specification does not say very clear about the first
load segment. In my edition 
"Tool Interface Standard (TIS)
Executable and Linking Format (ELF) 
Specification
Version 1.2",
there is such a sentence:
"The first text page contains the ELF header, the program header table, and
other information." (in the i386 sections ).
  So, I guess "the first load segment should contain program headers" is right
at least for a i386-elf target? moreover,the elf specification said "If it is
present,it must precede any loadable segment entry" about the PT_PHDR segment.

  Secondly, About the executable generated by the linker, I do NOT think it is
a valid ELF format.The elf specification said "it may occur only if the program
header table is part of the memory image of the program" about the PT_PHDR
segment. Thank goodness,this time the specification said things clear. The
generated  executable has a PT_PHDR,but the segment is NOT a part of memory
image of the program.
  lastly, about the patch. I feel sorry that it breaks many tests.Obviously,
the patch need much more work. Maybe we should make it a warning instead of a
fatal error? I am very glad to improve the patch, after we both agree with the
final plan. There are some important divergences anyway (does the elf required
the first load segment things?  target specific or general?warnings or
errors?).

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]