News for hackers. Stuff that matters.
Re:Using LibC in x86 Assembly Programs by georgecmu on Sunday March 25, 2012 @11:17AM (#3752789)
Using main and not _start is required by the gcc linker, any other symbol name will not work!.

Not really; while main is default, -e flag allows you to specify an arbitrary symbol as entry point.

Re:Using LibC in x86 Assembly Programs by KonradKlause on Sunday March 25, 2012 @12:31PM (#3752974)
AFAIK it's -e, not -E.
Re:Using LibC in x86 Assembly Programs by jdefr89 on Sunday March 25, 2012 @10:09PM (#3754604)
I should mention that. Thank you.
Re:Using LibC in x86 Assembly Programs by ypcx on Sunday March 25, 2012 @11:20AM (#3752797)
You can find more info on Linux (and System V) calling conventions, stack layout, etc. in this document: http://www.x86-64.org/documentation/abi.pdf
Re:Using LibC in x86 Assembly Programs by KonradKlause on Sunday March 25, 2012 @12:30PM (#3752969)
This covers only x8_64
Re:Using LibC in x86 Assembly Programs by ypcx on Sunday March 25, 2012 @01:40PM (#3753189)
True. This doc covers more targets: http://agner.org./optimize/calling_conventions.pdf

However, if I'm going to do low-level server work, I will not be doing it for 32-bit anymore. (There goes the 32-bit EC2 "small" machine, but so be it.)

Re:Using LibC in x86 Assembly Programs by drblast on Sunday March 25, 2012 @03:26PM (#3753517)
Why would anyone do this? If you've accepted that you're going to pay the cost to link against libc, use C. If you need to do something that specifically requires assembly, write that function (and that function only) in assembly. GCC will handle all of this very cleanly for you. You don't have to write main() in assembly.
Re:Using LibC in x86 Assembly Programs by msbarnett on Sunday March 25, 2012 @05:58PM (#3753977)
> Why would anyone do this?

Learning exercise? Curiosity? Fun?

Re:Using LibC in x86 Assembly Programs by sp332 on Monday March 26, 2012 @08:13AM (#3756251)
If you already have a codebase in assembly, and now you could really use a glibc call or two.
Re:Using LibC in x86 Assembly Programs by jdefr89 on Sunday March 25, 2012 @10:08PM (#3754602)
... The point is to use assembly, and a lot of people program in assembly simply for fun.
Re:Using LibC in x86 Assembly Programs by OwlHuntr on Sunday March 25, 2012 @02:09PM (#3753283)
As well intentioned as I imagine the author to be, there's really nothing here that you couldn't learn from older documentation, as several commentors have pointed out. A more interesting example would have been to calculate running time of some function vs. it's recursive version. Essentially, something besides an extended 'hello world'.
Re:Using LibC in x86 Assembly Programs by jdefr89 on Sunday March 25, 2012 @10:13PM (#3754613)
A lot of the stuff you read on here can be found in documentation.. Who the hell wants to go back and read all that nonsense?