public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Linkerscript
@ 2004-09-30 11:02 Meulendijks, J.
  2004-10-01  0:37 ` Linkerscript Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Meulendijks, J. @ 2004-09-30 11:02 UTC (permalink / raw)
  To: 'gcc-help@gcc.gnu.org'

Hi all,

I read the following on the internet:

"You can specify a file name to include sections from a particular file. You
would do this if one or more of your files contain special data that needs to be
at a particular location in memory. For example, use the following input.
  
data.o(.data)"

But when I use this the linker says: "cannot find data.o". But the linkcommand
is including the directory in which data.o is located. I do this with the -L
option.
I don't see what's is wrong with it but I only get this to work if I replace
"data.o(.data)" with "c:/bla/bla/data.o(.data)". So I must give the absolute
path and that's NOT what I want.

Thanks in advance.

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

* Re: Linkerscript
  2004-09-30 11:02 Linkerscript Meulendijks, J.
@ 2004-10-01  0:37 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2004-10-01  0:37 UTC (permalink / raw)
  To: Meulendijks, J.; +Cc: 'gcc-help@gcc.gnu.org'

"Meulendijks, J." <Meulendijks@WT.TNO.NL> writes:

> I read the following on the internet:

Well, there you go.  You can't trust the Internet.

> "You can specify a file name to include sections from a particular file. You
> would do this if one or more of your files contain special data that needs to be
> at a particular location in memory. For example, use the following input.
>   
> data.o(.data)"
> 
> But when I use this the linker says: "cannot find data.o". But the linkcommand
> is including the directory in which data.o is located. I do this with the -L
> option.
> I don't see what's is wrong with it but I only get this to work if I replace
> "data.o(.data)" with "c:/bla/bla/data.o(.data)". So I must give the absolute
> path and that's NOT what I want.

This is not a gcc question.  ld is part of the binutils.  For binutils
help, see http://sourceware.org/binutils/

In a linker script, using data.o within a SECTIONS command tells the
linker what to do with data.o, but it doesn't tell the linker to
actually use data.o.  Putting INPUT(data.o) in your linker script will
probably do what you want.  See the linker manual for more
information.

Ian

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

end of thread, other threads:[~2004-10-01  0:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-30 11:02 Linkerscript Meulendijks, J.
2004-10-01  0:37 ` Linkerscript Ian Lance Taylor

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).