Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

linker script and compilers.....

29 views
Skip to first unread message

Carlo Caione

unread,
May 3, 2010, 9:06:10 AM5/3/10
to
Hi,
I was trying to setup an environment to compile programs for an STM32.
One of the steps is to write a linker script.
Now my question is: what does the linker script depend on?
I think that it depends on the the compiler used. But, how can
I write from scratch a new linker script? I suppose I have to
know which are the sections present in my object file. But
they are so much dependent on the compiler?

Thanks,

--
Carlo

--- news://freenews.netfront.net/ - complaints: ne...@netfront.net ---

FreeRTOS info

unread,
May 3, 2010, 9:25:16 AM5/3/10
to

Yes - it is very dependent on the compiler being used, although you
don't mention the compiler you are actually using.

Normal practice would be to start with a linker script from an example
project provided with your compiler (or from the microcontroller vendors
site, or otherwise found elsewhere) that targets the microcontroller you
are using. If the microcontroller derivative is the same (same memory
map) then the chances are you won't even have to modify it.

[just noticed this was posted to gnu.gcc too, so I would guess you are
using GCC].

--

Regards,
Richard.

+ http://www.FreeRTOS.org
Designed for Microcontrollers. More than 7000 downloads per month.

+ http://www.SafeRTOS.com
Certified by TÜV as meeting the requirements for safety related systems.

Carlo Caione

unread,
May 3, 2010, 9:59:50 AM5/3/10
to
On 03/05/2010 15:25, FreeRTOS info wrote:

> Yes - it is very dependent on the compiler being used, although you
> don't mention the compiler you are actually using.
>
> Normal practice would be to start with a linker script from an example
> project provided with your compiler (or from the microcontroller vendors
> site, or otherwise found elsewhere) that targets the microcontroller you
> are using. If the microcontroller derivative is the same (same memory
> map) then the chances are you won't even have to modify it.
>
> [just noticed this was posted to gnu.gcc too, so I would guess you are
> using GCC].

Sorry for crossposting.
Yes, I would use ARM EABI Lite version of the CodeSourcery G++.
Thank you for your reply. And it is a nice coincidence because I'm
trying to put FreeRTOS on STM32 using Eclipse + CodeSourcery + openOCD.

Regards,

FreeRTOS info

unread,
May 3, 2010, 10:02:35 AM5/3/10
to

In which case, maybe this link will help you:
http://sites.google.com/a/stf12.net/developer-sw-fw/eclipse-demo

Grant Edwards

unread,
May 3, 2010, 10:26:29 AM5/3/10
to
On 2010-05-03, Carlo Caione <carlo....@gmail.com> wrote:

> I was trying to setup an environment to compile programs for an
> STM32. One of the steps is to write a linker script. Now my question
> is: what does the linker script depend on? I think that it depends on
> the the compiler used.

It depends on the compiler used (you need to know what section names
to expect) and on the linker used (you need to know the syntax and
semantics for linker scripts).

> But, how can I write from scratch a new linker script?

1) Read the manuals for the linker and compiler.

2) Look at existing linker scripts.

> I suppose I have to know which are the sections present in my object
> file.

Yes.

> But they are so much dependent on the compiler?

Yes.

--
Grant Edwards grant.b.edwards Yow! Gee, I feel kind of
at LIGHT in the head now,
gmail.com knowing I can't make my
satellite dish PAYMENTS!

0 new messages