WARNING: (374) ORDER command could not be obeyed for section STACK

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi Guys,

I am new to Google news groups, please let me know if this is the wrong
group.

I am an embedded C programmer with some experience, but I have come
accross a build error, while using MCC68K (Microtec C Compiler for
68000 series). I cannot figure out the exact reason for the error, and
I cannot seem to find any information on the error from documentation
that I have or from google search. So I have come here!

Here is a copy of the the last few lines before the linker error:
Linking :
        1 file(s) copied.
abisscan.obl
ber.obl
bistfunc.obl
control.obl
debug.obl
defs.obl
lapb.obl
layer2.obl
q703.obl
q704.obl
schedule.obl
x25.obl
WARNING: (374) ORDER command could not be obeyed for section STACK
 Errors: 0, Warnings: 1

The compilation of all my C and H files is ok, but during the link
stage I get the warning  as shown above.

If I remove the last changes that I made, then the error goes away.
However there seems to be nothing wrong with the code that I have added

(a simple static string array, the kind of which I have added many
times before).

I seem to remember having this problem once a long time ago, but I was
not experienced enough to deal with it - it seems nothing has changed!

Can anyone tell me why I get this error?, or where (what web site /
manual) I can get some information on this error. (I have looked at the

Microtec web site, but it is difficult to search for such a specific
topic).

Thanks for any help.
Best regards,
Alastair


Re: WARNING: (374) ORDER command could not be obeyed for section STACK
Quoted text here. Click to load it


Does this help?:

"The linker is unable to allocate memory in the order specified for the
section listed
in the ORDER command. A possible example is:

ORDERsect1,sect2,sect3
SECT sect2=0

Since sect2 must begin at address 0, there is no way sect1 can precede it."

From "Assembler/Linker/Librarian Users guide and reference for the 68000
family".

Regards
Richard.

http://www.FreeRTOS.org



Re: WARNING: (374) ORDER command could not be obeyed for section STACK

Quoted text here. Click to load it

Hi Richard,
Yes, this is certainly a step in the right direction, thanyou.

I'll go look this up - I think I was looking in the wrong manuals!

Thanks,
Alastair


Re: WARNING: (374) ORDER command could not be obeyed for section STACK

Quoted text here. Click to load it

Hi Richard,
I have resolved this now - two things worked:

Re-order the sections (e.g. in the example above put sect2 before
sect1).
Or, in my case decrease the size of one section so that it does not
overrun into the space of another section.

Thanks very much,
Alastair


Re: WARNING: (374) ORDER command could not be obeyed for section STACK

Quoted text here. Click to load it

This isn't "Google news groups" (Google provides an interface to
other newsgroups that already existed), so when posting here,
please be considerate of other users who are probably reading
your posts in the style of each post being a separate e-mail.

Quoted text here. Click to load it

This means the linker cannot lay out all of your variables in the
target's memory space, because there is not enough memory.
Your makefile (or whatever build system you use) will be telling the
linker how much space is available for static data, and you have just
exceeded that limit so the linker is saying that it all won't fit.

If you look in the .map file generated and search for that warning
message, you will see how much space it has and how much
space you need.

To solve the problem, either use less static data, or change your
device's memory layout (if that is possible of course -- plugging
larger numbers into the linker without thought, will just mean that
when you go and load the code to the device, it will try and use
memory that either doesn't physically exist, or is in use by some
other application or piece of hardware).

Quoted text here. Click to load it

If you don't understand the memory layout of the device you are
programming, it is certainly time to get in contact with the guys
who actually make the device and designed the programming
environment.

Quoted text here. Click to load it

You should get a support contract with whatever vendor has
supplied you the hardware and the development environment.

Also you could get a support contract with Microtec.

The compiler should have come with printed manuals (well,
mine did anyway), although the Microtec linker manual is
pretty sparse and doesn't answer many questions.


Re: WARNING: (374) ORDER command could not be obeyed for section STACK
Quoted text here. Click to load it

Heh heh... Yeah - NOW I know, I have just been getting loads of greif
about this from other groups! - but thanks for the warning!

Quoted text here. Click to load it

Yes, you are correct - I mad the amount of space used by the "heap"
(dynamic storage) smaller in exchange for more static storage, and this
fixed the problem.

Quoted text here. Click to load it

I origionally thought this was a coding issue, so I didn't look in the
Linker manual (I did check the compiler manual). Turns out there is
some information in the linker manual.

Thanks for your help,
Alastair


Site Timeline