too many object files work around for ld-elf.exe

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.
Post Reply
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

too many object files work around for ld-elf.exe

Post by xDDunce »

ok, so i finally get back up to speed with my old OS which was lost on my old laptop. but now when try to link my project, i can't because i exceed the limit of object files in the command line.

is there any sort of work around for this or is there an elf file linker that can support an unlimited (to a certain extent) number of object file parameters?

the reason i use ld-elf is because i use DJGPP and the ld included in that does not support elf format.

thanks in advance.

James.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: too many object files work around for ld-elf.exe

Post by neon »

How do you link? Ld-elf's linker script provides a way to tell the linker what object files to link without the command line... ie, LD's INPUT command.

You may also be able to use a make file.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: too many object files work around for ld-elf.exe

Post by xDDunce »

i tried a make file a few days ago but it turned into a big mess and i switched compilers 3 times and still ended up with DJGPP.

as for my linker at the moment:

Code: Select all

command line:
ld-elf -T link.ld -o kernel.sys objects...

link.ld:
OUTPUT_FORMAT("elf32-i386")
ENTRY(start)
phys = 0x00100000;
SECTIONS
{
  .text phys : AT(phys) {
    code = .;
    *(.text)
    *(.rodata)
    . = ALIGN(4096);
  }
  .data : AT(phys + (data - code))
  {
    data = .;
    *(.data)
    . = ALIGN(4096);
  }
  .bss : AT(phys + (bss - code))
  {
    bss = .;
    *(.bss)
    . = ALIGN(4096);
  }
  end = .;
}
so, how would i go about using the INPUT command?

James.

P.S. thanks for the fast reply! im stuck for things to do for now.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: too many object files work around for ld-elf.exe

Post by neon »

The command is:

Code: Select all

INPUT(object1.o object2.o object3.o)
I havnt actually used LD-ELF in awhile so I had to get the syntax again from my old system :) This should be put in your LD script file.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: too many object files work around for ld-elf.exe

Post by xDDunce »

thanks neon! works great now!

James
Post Reply