From: Frank K. <fbk...@co...> - 2005-06-30 01:22:08
|
John Daniels wrote: > Frank, > > If I throw in a bss or data section at the beginning > or end of the file, it no longer segfaults. That appears to be "expected" behavior with 2.6.11+. Whether it's "intended" behavior is still under discussion... > I wonder > why I don't need to do this with the gnu asssembler. Good question. Don't you? The code you cited: http://www.tldp.org/HOWTO/Assembly-HOWTO/hello.html ... indicates an explicit ".data" section for both the Nasm and (G)as versions. If a (G)as version works without a ".data" section... perhaps Gas makes a writable section at the end, whether you ask for one or not. I haven't tried it. Only thing I can think of. The 2.6 code appears to *require* that your executable have a writeable section, and that it be at the end (ld apparently takes care of the latter, if we use it). Curiously, marking the code section writeable seems to solve the problem using Fasm, but *not* using Nasm. This *may* indicate a bug in what Nasm's doing with "section .text write" - needs further research... Best, Frank |