Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » [Ubuntu x86_64] Linking Binary Files! (HELP)
- GeonoTRON2000
-
100+ posts
[Ubuntu x86_64] Linking Binary Files! (HELP)
I've successfully made a programs that dumps its executable data that is stored in memory to the STDOut. When I direct this output to a file, it works great, except I can't figure out how to link it with ELF. I get the following error:
Here's the linking command line I'm using:
Thanks in advance!
/usr/lib/x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
ld -b elf64-x86-64 -o selfprinthex /usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o -lc -b binary selfprint.hex -b elf64-x86-64 /usr/lib/x86_64-linux-gnu/crtn.o
Last edited by GeonoTRON2000 (May 29, 2013 00:58:08)
- TheMonsterOfTheDeep
-
1000+ posts
[Ubuntu x86_64] Linking Binary Files! (HELP)
What do you mean by “made a program?” If you're using e.g. C, then you can use gcc to link rather than calling ld directly.
Sadly, however, I can't help beyond that; I haven't actually learned much about the details of how to use ld. A cursory google search suggests that you probably don't have a ‘main’ method defined, which ld needs defined in order to make an executable.
Sadly, however, I can't help beyond that; I haven't actually learned much about the details of how to use ld. A cursory google search suggests that you probably don't have a ‘main’ method defined, which ld needs defined in order to make an executable.
- MegaApuTurkUltra
-
1000+ posts
[Ubuntu x86_64] Linking Binary Files! (HELP)
You need to tell the linker where the entry point of your executable data is. If you don't have anything besides your memory dump, you could try a base finder.
Last edited by MegaApuTurkUltra (Jan. 27, 2018 20:59:09)
- TheAspiringHacker
-
100+ posts
[Ubuntu x86_64] Linking Binary Files! (HELP)
This topic is from 2013? Did @TheMosterOfTheDeep necropost or was a post deleted that bumped this topic back to the front page?
- cheeseeater
-
1000+ posts
[Ubuntu x86_64] Linking Binary Files! (HELP)
TheMonsterOfTheDeep didn't necropost. It was just more asinine spam that keeps finding its way on here. This topic is from 2013? Did @TheMosterOfTheDeep necropost or was a post deleted that bumped this topic back to the front page?
- Jonathan50
-
1000+ posts
[Ubuntu x86_64] Linking Binary Files! (HELP)
This topic was on the very last page, then somebody bumped it and it got deleted. This topic is from 2013? Did @TheMosterOfTheDeep necropost or was a post deleted that bumped this topic back to the front page?
- MegaApuTurkUltra
-
1000+ posts
[Ubuntu x86_64] Linking Binary Files! (HELP)
aaa didn't see the date
Maybe the ST should close old topics that get bumped by spam when they delete the spam?
Maybe the ST should close old topics that get bumped by spam when they delete the spam?
- TheMonsterOfTheDeep
-
1000+ posts
[Ubuntu x86_64] Linking Binary Files! (HELP)
Ah shoot. Didn't notice the date. This topic is from 2013? Did @TheMosterOfTheDeep necropost or was a post deleted that bumped this topic back to the front page?
Yup, it was spam.
- Discussion Forums
- » Advanced Topics
-
» [Ubuntu x86_64] Linking Binary Files! (HELP)