Hey, as an exercise to learn more precisely how c programs work and what minimum level of content must exist for a program to be able to use libc, ive taken it upon myself to attempt to program primarily in x86 assembly using gas and ld. As a fun little challenge, I've successfully assembled and linked several programs linked to different self-made dynamic libraries, but i have failed to be able to code a program from scratch to use libc function calls without directly using gcc. I understand the calling conventions of individual c library functions, and have thoroughly inspected programs compiled out of gcc through use of objdump and readelf, but havent gotten anywhere as far as what information to include in a gas assembly file and what parameters to invoke in ld to successfully link to libc. Anyone have any insight to this?
btw, im running linux, using gnu toolchain on an x86 machine, to clarify the obvious.