Linking with an odd setup via a linker script assistance

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
amyipdev
Posts: 18
Joined: Tue Nov 09, 2021 11:40 am

Re: Linking with an odd setup via a linker script assistance

Post by amyipdev »

@Octocontrabass

This still seems to be an issue. I can't get it to link properly for whatever reason, it's highly bizarre.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Linking with an odd setup via a linker script assistance

Post by neon »

Hi,

Can't really address the LD side just wanted to comment that it doesnt make sense to attempt to link a boot sector given it lacks any symbolic information (has nothing that can be linked). Our boot loader core is also at 64k however we keep things separate as they are all separate programs.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

Re: Linking with an odd setup via a linker script assistance

Post by Octocontrabass »

amyipdev wrote:@Octocontrabass

This still seems to be an issue. I can't get it to link properly for whatever reason, it's highly bizarre.
Unfortunately, I wasn't able to reproduce the issue with the information you've posted so far. Can you upload the files you're currently using and the exact commands you run to get the broken binary?
neon wrote:it doesnt make sense to attempt to link a boot sector given it lacks any symbolic information
You just have to tell your compiler or assembler to produce an object file that contains symbols so the linker will have something to work with.
amyipdev
Posts: 18
Joined: Tue Nov 09, 2021 11:40 am

Re: Linking with an odd setup via a linker script assistance

Post by amyipdev »

@Octocontrabass

I've reuploaded the files for you here.
Attachments
linker.ld
(155 Bytes) Downloaded 35 times

[The extension s has been deactivated and can no longer be displayed.]

[The extension s has been deactivated and can no longer be displayed.]

Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

Re: Linking with an odd setup via a linker script assistance

Post by Octocontrabass »

What commands are you running to get a binary out of those files?
Post Reply