On 03-01-2014 12:19 PM, Joey Ye wrote:
> On Thu, Jan 2, 2014 at 2:57 PM, Suprateeka R Hegde
> <
hegdes...@gmail.com> wrote:
>> I would say SHF_NOREAD alone would not be generic solution in ELF. It is
>> because in future, we may have another proprietary system that needs
>> SHF_NOWRITE or SHF_NOEXEC. So we have to make it generic enough considering
>> all future possibilities.
> If NOWRITE/NOEXEC will be defined, it is nature to also have NOREAD.
Right. Then I believe, there is a need for clear definition in standard
terms comprising all these instead of just SHF_NOREAD. What I am saying
is that SHF_NOREAD is a negative attribute compared to the existing
SHF_WRITE, SHF_EXECINSTR, etc., in the SHF_* group. Adding attributes as
per the immediate specific necessity may render the specification more
ambiguous.
I would say, the definition of the new set of attribute must tell
- what are the valid combinations possible with the existing ones
- what are the strict semantics and what are allowable/system dependent
semantics. For instance, PF_X also allows read permission.
- A generic practical use of the new attribute. What exactly is NOREAD?
Is it noread for external programs like debuggers and dumpers? Or is it
noread absolutely? If absolutely noread, then how would a generic system
with the most common (von-neumann?) architecture would benefit from this
as at least the execution unit in the CPU (even if hardwired) has to
fetch ("read") the instructions.
- Is this useful only for embedded systems?
- etc.
If all these are clear, everyone on the forum may find the usefulness as
a generic solution and there could be a good consensus to make it to the
gABI.
>> I would say, the existing ELF suggests, all such execute only sections be
>> linked to a segment with only PF_X set. Doesnt this work?
> Attribute of the output segment doesn't work. What's missing is
> attribute of input sections. I'm seeking a generic solution to pick up
> input sections with certain characteristics and output to a PF_X
> segment.
My personal opinion in this case would be to go with SHF_MASKOS (or
MASKPROC if there are many systems like STM using ARM), as finally your
requirement is to form a segment with PF_X set. There are so many
proprietary compilers that use SHF_MASKOS range to generate
characteristic input sections that finally merge to a gABI conforming
segment.
That said, you may ask for further comments from others on the forum
regarding the usefulness for adding this (SHF_NOREAD alone) to gABI.
--
Supra