Page 1 of 1

LD issues (SOLVED)

Posted: Fri Jul 09, 2010 3:45 am
by dukedevon
I try to link a compiled c++ kernel as described here

link.ld fails with the following error:

Code: Select all

opened script file .\link.ld
using external linker script:
==================================================
OUTPUT_FORMAT("binary")
ENTRY(start)
SECTIONS
{
        .text 0x100000 :
        {
                code = .; _code = .; __code = .;
                *(.text)
                . = ALIGN(4096);
        }

        .bss :
        {
                bss = .; _bss = .; __bss = .;
                *(.bss)
                . = ALIGN(4096);
        }

        .data :
        {
                __CTOR_LIST__ = .; LONG((__CTOR_END__-__CTOR_LIST__) / 4 - 2) *(.ctors) LONG(0) __CTOR_END__ = .;
                __DTOR_LIST__ = .; LONG((__DTOR_END__-__DTOR_LIST__) / 4 - 2) *(.dtors) LONG(0) __DTOR_END__ = .;

                data =.; _data = .; __data = .;
                *(.data)
                . = ALIGN(4096);
        }

        end =.; _end =.; __end = .;
}


==================================================
attempt to open data failed
c:/djgpp/bin/ld.exe: cannot find data
Googleing the issue didn't help me. Any ideas?
(Sorry for my bad english)

Re: LD issues

Posted: Fri Jul 09, 2010 5:39 am
by qw
What is the command line you invoke LD with?

Re: LD issues

Posted: Fri Jul 09, 2010 5:43 am
by dukedevon
Windoze Powershell

Re: LD issues

Posted: Fri Jul 09, 2010 5:48 am
by qw
With command line I mean something like "ld -T link.ld ..."

Re: LD issues

Posted: Sat Jul 10, 2010 3:15 am
by dukedevon

Code: Select all

ld --verbose -T link.ld -o kernel.bin loader.o main.o Video.o

Re: LD issues (SOLVED)

Posted: Mon Jul 12, 2010 1:44 am
by qw
I see the problem is solved already. Could you tell us what it was and how you solved it?

Re: LD issues (SOLVED)

Posted: Mon Jul 12, 2010 2:50 am
by dukedevon
I forgot to compile one of the files. Sorry for bothering this forum. I was very tired and not able to find the issue myself.

Re: LD issues (SOLVED)

Posted: Mon Jul 12, 2010 3:57 am
by qw
Hehe, don't worry. There even is a thread for situations like this: http://forum.osdev.org/viewtopic.php?t=19076.