This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: how to get the correct ld command from gcc
- From: "J. Johnston" <jjohnstn at redhat dot com>
- To: Jibin Han <jihan at eece dot unm dot edu>
- Cc: newlib at sources dot redhat dot com
- Date: Mon, 04 Mar 2002 17:00:58 -0500
- Subject: Re: how to get the correct ld command from gcc
- Organization: Red Hat Inc.
- References: <Pine.SOL.4.21.0203041428090.4345-100000@rayo.eece.unm.edu>
Jibin Han wrote:
>
> Hi,
> I am using such command to build an elf image to trigger
> ld: "powerpc-eabi-gcc $(CFLAGS) -Wl,-T,$(LDSFILE) -o $@ boot.o
> $(OBJECTS) -lc $(BSP) -lc $(DRIVER_LIB)". now I want to trigger ld with
> -Map option, I tried appending "-Map mapfile" to the command above, but
> gcc can not recognize it.
> I then did this way, "powerpc-eabi-ld -Wl,-T,$(LDSFILE) -o $@
> boot.o $(OBJECTS) -lc $(BSP) -lc $(DRIVER_LIB) -Map mapfile", but it says
> can not recognize powerpc-eabi-ld options.
> could you pint me any method based on this command how to get the
> map info from ld -Map?
>
> thanks.
>
> newbie
Jibin,
To pass options to the link stage, use the -Wl option. You are
already doing so for the -T option. Therefore, just add
-Wl,-Map,some-file-name to your invocation.
-- Jeff J.