This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: linker scripting: locating overlays after main code
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: "Ian Montgomerie" <imontgom at lsil dot com>
- Cc: <binutils at sources dot redhat dot com>
- Date: 07 Apr 2004 15:00:21 -0400
- Subject: Re: linker scripting: locating overlays after main code
- References: <010f01c41cd1$8713a250$0100000a@imontgompc2k>
"Ian Montgomerie" <imontgom@lsil.com> writes:
> I hit a big roadblock. To put all objects other than ovl1 and ovl2 in a
> certain place, I need to create a section using wildcards. But the moment I
> put a section with wildcards, it grabs EVERY file and I can't reference any
> other objects later in the linker script.
Yeah, it's a problem. If you could put the OVERLAY first in the
linker script it would probably work, but you probably don't want to
do that because then you won't be able to easily set the output
section address.
You could use incredibly hackish workarounds, like
[A-Z0-9a-n]*(.text)
o[a-u]*(.text)
o[w-z]*(.text)
[p-z]*(.text)
etc.
It gets pretty grim pretty quickly, though. I don't know of a good
solution to this. Probably when the linker assigns input sections to
output sections it should do some sort of sort on file names, so that
they get associated with the most specific reference. Currently,
though, it just goes through the linker script in order and uses the
first match, as indeed is documented.
Ian