LD issues (SOLVED)

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
dukedevon
Posts: 21
Joined: Thu Jul 08, 2010 10:02 am
Location: Karlsruhe, Germany
Contact:

LD issues (SOLVED)

Post 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)
FlExOS --- Stay tuned ;-)
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: LD issues

Post by qw »

What is the command line you invoke LD with?
User avatar
dukedevon
Posts: 21
Joined: Thu Jul 08, 2010 10:02 am
Location: Karlsruhe, Germany
Contact:

Re: LD issues

Post by dukedevon »

Windoze Powershell
FlExOS --- Stay tuned ;-)
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: LD issues

Post by qw »

With command line I mean something like "ld -T link.ld ..."
User avatar
dukedevon
Posts: 21
Joined: Thu Jul 08, 2010 10:02 am
Location: Karlsruhe, Germany
Contact:

Re: LD issues

Post by dukedevon »

Code: Select all

ld --verbose -T link.ld -o kernel.bin loader.o main.o Video.o
FlExOS --- Stay tuned ;-)
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: LD issues (SOLVED)

Post by qw »

I see the problem is solved already. Could you tell us what it was and how you solved it?
User avatar
dukedevon
Posts: 21
Joined: Thu Jul 08, 2010 10:02 am
Location: Karlsruhe, Germany
Contact:

Re: LD issues (SOLVED)

Post 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.
FlExOS --- Stay tuned ;-)
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: LD issues (SOLVED)

Post by qw »

Hehe, don't worry. There even is a thread for situations like this: http://forum.osdev.org/viewtopic.php?t=19076.
Post Reply