Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22202

How to Manually Link .o files in C (x86, 64 bit architecture)

$
0
0

I'm trying to accomplish what gcc is able to accomplish by running each command individually to better grasp what is happening when I compile my c programs. However, after following this chain of executionfor some file main.c:

cpp main.c a.i/pathtocc1/cc1 a.i -o a.sas a.s -o a.old a.o /pathtolibc/libc.so -o a.out

I get the warning: ld: cannot find entry symbol _start; defaulting to 0000000000401020

and file not found when I attempt to run the linked ELF executable a.out

What do I need to do to bring _start into the equation? I'm running these commands through MATE Terminal on Linux MATE 1.24.0


Viewing all articles
Browse latest Browse all 22202

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>