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] Unexpected behavior with -nostdlib


Greetings,

Thank you for your time and the reply. I figured that if it was intended
behavior, the reasoning would be something along those lines. The reason
I asked here and not in gcc's mailing list was because I found the
option in ld as well as gcc. Again, thank you.

Cheers,
Orlando.

On 02/15/2017 06:29 AM, Nick Clifton wrote:
> 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.
> 
> Cheers
>   Nick
> 
> 

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]