This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [MSP430-elf] Linking issue


Greetings,

Passed the option to LD, attached is the output. You are indeed correct
that collect2 is receiving the linker script twice:

COLLECT_GCC_OPTIONS='-v' '-o' 'blink.elf' '-mmcu=msp430f2013'
'-mmcu=msp430f2013' '-fdata-sections' '-ffunction-sections'
'-specs=nosys.specs'
 /usr/lib/gcc/msp430-elf/5.2.0/collect2 -plugin
/usr/lib/gcc/msp430-elf/5.2.0/liblto_plugin.so
-plugin-opt=/usr/lib/gcc/msp430-elf/5.2.0/lto-wrapper
-plugin-opt=-fresolution=/tmp/cckFVMn4.res
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lcrt
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lnosys
--sysroot=/usr/msp430-elf -o blink.elf
/usr/lib/gcc/msp430-elf/5.2.0/../../../../msp430-elf/lib/430/crt0.o
/usr/lib/gcc/msp430-elf/5.2.0/430/crtbegin.o
-L/usr/lib/gcc/msp430-elf/5.2.0/430
-L/usr/lib/gcc/msp430-elf/5.2.0/../../../../msp430-elf/lib/430
-L/usr/msp430-elf/lib/430 -L/usr/msp430-elf/usr/lib/430
-L/usr/lib/gcc/msp430-elf/5.2.0
-L/usr/lib/gcc/msp430-elf/5.2.0/../../../../msp430-elf/lib
-L/usr/msp430-elf/lib -L/usr/msp430-elf/usr/lib main.o -lgcc
--start-group -lc -lgcc -lcrt --end-group --script=msp430f2013.ld
--script=msp430f2013.ld -lgcc --start-group -lgcc -lc -lnosys
--end-group /usr/lib/gcc/msp430-elf/5.2.0/430/crtend.o
/usr/lib/gcc/msp430-elf/5.2.0/../../../../msp430-elf/lib/430/crtn.o -lgcc

However, I do not know if it is due to nosys.specs:
$ cat /usr/msp430-elf/lib/nosys.specs
%rename link_gcc_c_sequence                nosys_link_gcc_c_sequence

*nosys_libgloss:
-lnosys

*nosys_libc:
%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano}

*link_gcc_c_sequence:
%(nosys_link_gcc_c_sequence) --start-group %G %(nosys_libc)
%(nosys_libgloss) --end-group

[The first line caused conflicts with the redefinition in an older
version of the toolchain, by the way.]

I am not even sure why the linker is receiving the mmcu parameter twice.
Thank you for helping me look into this.

Cheers, Orlando.

On 09/28/2015 05:04 PM, DJ Delorie wrote:
> Add "-v" to LD= to find out exactly what command line gcc is using to
> invoke the linker; you might find that it's including the *.ld file
> twice (possibly due to nosys.specs?).
> 

Attachment: make.log
Description: Text document

Attachment: signature.asc
Description: OpenPGP digital signature


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