Strange behaviour, program segfaults

André Reffhaug areffhaug at gmail.com
Mon Apr 10 08:28:58 PDT 2006


On 4/10/06, Michael Urman <mu at tortall.net> wrote:
> Just as a data point, since I don't know gas the way Peter does. I get
> the following errors when I run it with your code:
>
> % ./yasm -p gas -f elf gastest.asm
> % ld gastest.o -o gastest
> ld: gastest: warning: allocated section `.text' not in segment
> % ./gastest
> zsh: exec format error: ./gastest
>
> When I crossreferenced for the usage in our test cases, it uses ".text"
> instead of ".section .text" so I tried that and it seems to execute
> properly:
>
> % ./gastest
> zsh: exit 33    ./gastest
>
> Peter will have to sort out whether this behavior is by design or by
> accident. Since you say it works with as, I'm going to guess it's a
> design oversight. And a great thing to catch before the final release of
> 0.5.0! :)
>
> Michael
> --
> Michael Urman  [- mu at tortall.net -]

Hey Michael!

This is quite interesting. First off, my ld doesn't give me the
warning you get for the .section .text-line at all. It just links in
silence. (ld version 2.16.1).

And second, when removing ".section" from the sourcecode, the compiled
version still segfaults on my system. Yasm is latest release, rc2.

Very strange, and perhaps import as to a new release.

Regards,
André Reffhaug


More information about the yasm-devel mailing list