1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

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

Discussion in 'Embedded' started by Alastair, Jan 3, 2006.

  1. Alastair

    Alastair Guest

    Hi Guys,

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

    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.
    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

    Thanks for any help.
    Best regards,
    Alastair, Jan 3, 2006
    1. Advertisements

  2. Alastair

    Richard Guest

    I am an embedded C programmer with some experience, but I have come

    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:

    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


    Richard, Jan 3, 2006
    1. Advertisements

  3. Alastair

    Alastair Guest

    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!

    Alastair, Jan 3, 2006
  4. Alastair

    Alastair Guest

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

    Re-order the sections (e.g. in the example above put sect2 before
    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, Jan 4, 2006
  5. Alastair

    Old Wolf Guest

    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.
    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).
    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
    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.
    Old Wolf, Jan 4, 2006
  6. Alastair

    Alastair Guest

    This isn't "Google news groups" (Google provides an interface to
    Heh heh... Yeah - NOW I know, I have just been getting loads of greif
    about this from other groups! - but thanks for the warning!
    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.
    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, Jan 5, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.