public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [Fwd: Re: [Fwd: Linker problems]]
@ 2010-04-17 14:10 Andrei B
  2010-04-17 17:53 ` Ian Lance Taylor
  0 siblings, 1 reply; 7+ messages in thread
From: Andrei B @ 2010-04-17 14:10 UTC (permalink / raw)
  To: binutils

---------------------------- Original Message ----------------------------
Subject: Re: [Fwd: Linker problems]
From:    "Andrei B" <baie0668@localhost>
Date:    Sat, April 17, 2010 5:07 pm
To:      "Ian Lance Taylor" <iant@google.com>
--------------------------------------------------------------------------

>
> I'm not sure what you mean by "a flat binary."
>
> Precisely how is ld being invoked?
>

Hello. This is how:
---
ld -T link.ld -o kernel.bin start.o main.o scrn.o gdt.o idt.o isrs.o irq.o
timer.o kb.o
---

start.o is assembled by NASM and is a:
start.o: Linux/i386 impure executable (OMAGIC)
All other objects compiled with GCC.

Below is the link.ld script:
---
OUTPUT_FORMAT("binary")
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 = .;
}
---
Also, to any moderators: please organize these messages if you see fit. I
am having a webmail problem which prevents me from replying directly to
the other user. Until I figure out what's wrong I can only forward my
replies.
-AB


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Fwd: Re: [Fwd: Linker problems]]
  2010-04-17 14:10 [Fwd: Re: [Fwd: Linker problems]] Andrei B
@ 2010-04-17 17:53 ` Ian Lance Taylor
  2010-04-17 18:50   ` Andrei B
  2010-04-17 18:54   ` Andrei B
  0 siblings, 2 replies; 7+ messages in thread
From: Ian Lance Taylor @ 2010-04-17 17:53 UTC (permalink / raw)
  To: Andrei B; +Cc: binutils

"Andrei B" <baie0668@scs.ubbcluj.ro> writes:

> ld -T link.ld -o kernel.bin start.o main.o scrn.o gdt.o idt.o isrs.o irq.o
> timer.o kb.o

> start.o is assembled by NASM and is a:
> start.o: Linux/i386 impure executable (OMAGIC)
> All other objects compiled with GCC.

I suppose I don't see how this could work.  The linker is only able to
link object files, not executable files.  I've never looked at NASM in
detail; does it have any option to emit an object file rather than an
executable file?  Why is NASM involved here anyhow?

Ian

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Fwd: Re: [Fwd: Linker problems]]
  2010-04-17 17:53 ` Ian Lance Taylor
@ 2010-04-17 18:50   ` Andrei B
  2010-04-20 15:03     ` Ian Lance Taylor
  2010-04-17 18:54   ` Andrei B
  1 sibling, 1 reply; 7+ messages in thread
From: Andrei B @ 2010-04-17 18:50 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: binutils

> I suppose I don't see how this could work.  The linker is only able to
> link object files, not executable files.  I've never looked at NASM in
> detail; does it have any option to emit an object file rather than an
> executable file?  Why is NASM involved here anyhow?
>

In my first post here (or how you call it) I have given the links to the
kernel I'm trying to compile, from Bran's kernel development tutorial.
It's code dating back to 2005 and he appears to have been using Windows to
compile it. I have "converted" his DOS batch file to a Makefile, without
changing anything in the source or how the tools were invoked. He was
using Win32/DOS versions of GCC, NASM and LD.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Fwd: Re: [Fwd: Linker problems]]
  2010-04-17 17:53 ` Ian Lance Taylor
  2010-04-17 18:50   ` Andrei B
@ 2010-04-17 18:54   ` Andrei B
  1 sibling, 0 replies; 7+ messages in thread
From: Andrei B @ 2010-04-17 18:54 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: binutils

Reposting download link to Bran's work:
http://www.osdever.net/bkerndev/bkerndev.zip

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Fwd: Re: [Fwd: Linker problems]]
  2010-04-17 18:50   ` Andrei B
@ 2010-04-20 15:03     ` Ian Lance Taylor
  2010-04-20 17:10       ` Andrei B
  0 siblings, 1 reply; 7+ messages in thread
From: Ian Lance Taylor @ 2010-04-20 15:03 UTC (permalink / raw)
  To: Andrei B; +Cc: binutils

"Andrei B" <baie0668@scs.ubbcluj.ro> writes:

>> I suppose I don't see how this could work.  The linker is only able to
>> link object files, not executable files.  I've never looked at NASM in
>> detail; does it have any option to emit an object file rather than an
>> executable file?  Why is NASM involved here anyhow?
>>
>
> In my first post here (or how you call it) I have given the links to the
> kernel I'm trying to compile, from Bran's kernel development tutorial.
> It's code dating back to 2005 and he appears to have been using Windows to
> compile it. I have "converted" his DOS batch file to a Makefile, without
> changing anything in the source or how the tools were invoked. He was
> using Win32/DOS versions of GCC, NASM and LD.

Thanks, but, to be honest, I'm not going to spend my limited time
reading a five year old kernel development tutorial written to work on
Windows.  I would encourage you to take these questions as guides that
may help you to resolve the problem.

Ian

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Fwd: Re: [Fwd: Linker problems]]
  2010-04-20 15:03     ` Ian Lance Taylor
@ 2010-04-20 17:10       ` Andrei B
  2010-04-21 14:47         ` Ian Lance Taylor
  0 siblings, 1 reply; 7+ messages in thread
From: Andrei B @ 2010-04-20 17:10 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: binutils

> Thanks, but, to be honest, I'm not going to spend my limited time
> reading a five year old kernel development tutorial written to work on
> Windows.  I would encourage you to take these questions as guides that
> may help you to resolve the problem.
>

Another user posted about fno-builtin not working, which could be the same
problem that I have. Do the GCC folk have a separate mailing list?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Fwd: Re: [Fwd: Linker problems]]
  2010-04-20 17:10       ` Andrei B
@ 2010-04-21 14:47         ` Ian Lance Taylor
  0 siblings, 0 replies; 7+ messages in thread
From: Ian Lance Taylor @ 2010-04-21 14:47 UTC (permalink / raw)
  To: Andrei B; +Cc: binutils

"Andrei B" <baie0668@scs.ubbcluj.ro> writes:

>> Thanks, but, to be honest, I'm not going to spend my limited time
>> reading a five year old kernel development tutorial written to work on
>> Windows.  I would encourage you to take these questions as guides that
>> may help you to resolve the problem.
>>
>
> Another user posted about fno-builtin not working, which could be the same
> problem that I have. Do the GCC folk have a separate mailing list?

Yes, gcc-help@gcc.gnu.org.  For issues concerning gcc development,
there is gcc@gcc.gnu.org.  See http://gcc.gnu.org/lists.html .

Ian

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-04-21 14:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-17 14:10 [Fwd: Re: [Fwd: Linker problems]] Andrei B
2010-04-17 17:53 ` Ian Lance Taylor
2010-04-17 18:50   ` Andrei B
2010-04-20 15:03     ` Ian Lance Taylor
2010-04-20 17:10       ` Andrei B
2010-04-21 14:47         ` Ian Lance Taylor
2010-04-17 18:54   ` Andrei B

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).