tech-toolchain archive

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

Re: Trouble with new GNU_STACK segment



In article <47319df87dc.4b8412a5%mail.owl.de@localhost>,
Frank Wille  <frank%phoenix.owl.de@localhost> wrote:
>On 06.11.15 19:29:26 I wrote:
>
>> [...] So I was looking for reasons and finally found
>> that the additional GNU_STACK segment in the kernel is the problem.
>> [...]
>> "readelf -l" on current kernel:
>>
>> Program Headers:
>>   Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg
>>   Align LOAD           0x000080 0x00100000 0x00100000 0x1f7a4c 0x210d20
>>   RWE 0x40 GNU_STACK      0x000000 0x00000000 0x00000000 0x00000
>>   0x00000 RWE 0x4
>
>Additional information:
>"Only" PowerPC executables and kernels are affected. You find GNU_STACK in
>the kernels of all PPC ports.
>
>So there's just something which has been forgotten in the PowerPC tools?
>
>In PPC object files there is also this ".note.GNU-stack" section, which is
>missing for other architectures. From a short glance at the ld sources I
>think that the GNU_STACK segment is automatically created when such a
>section was found in any object file.
>
>But I see no option to suppress ".note.GNU-stack" in objects...

Yes, I guess the best thing is to strip it with a linker script. It
seems to be done on purpose:

#if defined (POWERPC_LINUX) || defined (POWERPC_FREEBSD) \
    || defined (POWERPC_NETBSD)
      if (TARGET_32BIT || DEFAULT_ABI == ABI_ELFv2)
	  file_end_indicate_exec_stack ();
#endif

christos




Home | Main Index | Thread Index | Old Index