how to get the correct ld command from gcc
J. Johnston
jjohnstn@redhat.com
Mon Mar 4 14:01:00 GMT 2002
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.
More information about the Newlib
mailing list