This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Specifying command line arguments in a file?


"H . J . Lu" wrote:

> On Tue, May 01, 2001 at 12:50:19AM -0400, dewar@gnat.com wrote:
> > Note that several linkers do have this kind of capability (to read lists
> > of objects from a file). This capability is available on both DEC Unix
> > (Tru64) and IRIX. It seems a useful feature for any linker.
> >
> > Sure you can put objects in a .a library but that is often not convenient
> > when you are building big systems. You can still reach command line length
> > limits even after breaking things down into subsystems.
>
> You can put a list of objects in a file with th GNU ld. Under Linux,
>
> # cat /usr/lib/libc.so
> /* GNU ld script
>    Use the shared library, but some functions are only in
>    the static library, so try that secondarily.  */
> GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a )

H.J.

Will this work without providing a complete linker script, i.e. without using
SECTION in the linker script?

If this is the case I am wondering why my linker script that has only
EXTERN statement in it does not work.

For example if I have the following script.

EXTERN(ucorr_);
EXTERN(uel_);
EXTERN(uexpan_);
EXTERN(uexternaldb_);
EXTERN(ufield_);
EXTERN(ufluid_);

and provide the script name on the command line for linking a shared library on
Linux I do get a runtime failure when the library is loaded with the message
that "uexternaldb_" is undefined. However, when I link the same object and
archive code but use -u uexternaldb_ -u .... the shared library works just
fine.
This indicates to me that either the script mechanism is broken in ld or I am
not allowed to create a linker script that does not supply memory layout
information. Or is there a special trick that I am over looking in your
suggested approach?

Thanks,
Robert


--
Robert Schweikert                   MAY THE SOURCE BE WITH YOU
                                             LINUX




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]