Page 1 of 1

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

Posted: Sun Sep 07, 2008 11:06 am
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.

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

Posted: Sun Sep 07, 2008 11:12 am
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.

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

Posted: Sun Sep 07, 2008 11:29 am
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.

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

Posted: Sun Sep 07, 2008 11:43 am
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.

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

Posted: Sun Sep 07, 2008 11:47 am
by xDDunce
thanks neon! works great now!

James