You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One annoyance is that I'm still calling the external C compiler cc to do the linking.
...
I assume that it should be possible to do a similar command on current Linux, but so far my Google-fu isn't enough to work this out. If you read this and know the answer, let me know!
Now I know how to link without using gcc:
Assuming we have a obj file named out.o, we can execute the following command to generate an executable file:
$ ld -o out out.o /lib/x86_64-linux-gnu/crt1.o -lc -dynamic-linker /lib64/ld-linux-x86-64.so.2
crt1.o is a starter which calls main
-lc link libc or other libs if we need
ld-linux-x86-64.so.2 helps to load dynamic libs
If ld-linux-x86-64.so.2 or crt1.o is not found, you may find them by locate or any other command.
I don't know if additional parameters will be needed in the future, but they do work for now.
If you see this message, please tell me it works.
Thanks :)
The text was updated successfully, but these errors were encountered:
Hi, doctor:
I'm not sure if you're still following this repo, but I sincerely want to give you some response.
in Part-28, you mentioned that:
Now I know how to link without using gcc:
Assuming we have a obj file named
out.o
, we can execute the following command to generate an executable file:crt1.o
is a starter which calls main-lc
linklibc
or other libs if we needld-linux-x86-64.so.2
helps to load dynamic libsI don't know if additional parameters will be needed in the future, but they do work for now.
If you see this message, please tell me it works.
Thanks :)
The text was updated successfully, but these errors were encountered: