[haiku-development] Re: ELF Stack Program Header type

  • From: David McPaul <dlmcpaul@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 10 Apr 2009 06:09:30 +1000

2009/4/10 Schrijvers Luc <Begasus@xxxxxxxxx>:
> Op donderdag 09-04-2009 om 18:04 uur [tijdzone +0200], schreef Ingo
> Weinhold:
>> On 2009-04-09 at 14:18:17 [+0200], David McPaul <dlmcpaul@xxxxxxxxx> wrote:
>> >
>> > When compiling avcodec with yasm the resulting object ends up with a
>> > STACK program header type which is not supported by the Haiku runtime
>> > loader.
>> >
>> > objdump gives me
>> >
>> > Program Header:
>> >     LOAD off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12
>> >          filesz 0x00293d70 memsz 0x00293d70 flags r-x
>> >     LOAD off    0x00293d70 vaddr 0x00294d70 paddr 0x00294d70 align 2**12
>> >          filesz 0x000109d8 memsz 0x003485d8 flags rw-
>> >  DYNAMIC off    0x00294430 vaddr 0x00295430 paddr 0x00295430 align 2**2
>> >          filesz 0x000000d0 memsz 0x000000d0 flags rw-
>> >    STACK off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**2
>> >          filesz 0x00000000 memsz 0x00000000 flags rwx
>> [...]
>> > Any thoughts on supporting this program header?
>>
>> At least the System V ABI specs (4.1) don't mention a type PT_STACK. It's
>> also interesting that it both a zero file and memory size, which makes me
>> wonder how it could be good for anything.
>>
>> CU, Ingo
>>
> I've had the same problem (or still have for that matter) in scummvm,
> problem are these offending lines:
>
>  1910 %ifidn __OUTPUT_FORMAT__,elf
>  1911 section .note.GNU-stack noalloc noexec nowrite progbits
>  1912 %endif
>
> they are responsible for adding the extra header gnu_stack to scummvm where 
> Haiku doesn't know what to do with.
> IIRC it has been mentioned in bug tracker also. You probly have to look for 
> some lines simular like these who are responsible for the header.
> Removing them from the source in scummvm resolved the problem with scummvm 
> not running in Haiku. (ZETA didn't had the problem with the extra header).


Yes there is something similar in the avcodec assembly sources.

I think our loader should handle it though.

-- 
Cheers
David

Other related posts: