This is the mail archive of the 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] Unexpected behavior with -nostdlib

Hi Orlando,

> When passing -nostdlib to the linker command, the default/simulator
> linker script is used instead of the MCU specific linker script as
> specified in the parameter list with the -mmcu flag.

This is actually intended, albeit poorly documented, behaviour.

First of all, this is a gcc problem, not a binutils problem.  At issue
here is the compiler driver program (called gcc) which is responsible
for invoking the compiler proper (cc1), the assembler and the linker.
It is this program which sees the -nostdlib command line option and
decides to discard the linker command line option that selects the MCU
specific linker script.

> I am able to override the behavior using the proper -Wl,-T commands to
> force the utilization of a linker script, but this seems less than
> elegant. 

True - but the intention is that if you are using -nostdlib, then you must
know what you are doing *and* that you want total control over which libraries,
start-up files and linker scripts are used to create your application.  Hence
-nostdlib disables the automatic linker script selection and you must use
-Wl,-T to select your own.


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