#112 _stack_end definition missing for pic16

open
5
2010-01-17
2006-01-14
No

This problem appears specific to mpic16. Using other
processors (such as z80) appears to work OK.

sdcc -mpic16 a.c

message: using default linker script
"/usr/local/share/gputils/lkr/18f452.lkr"
error: missing definition for symbol "_stack_end",
required by
"/usr/local/bin/../share/sdcc/lib/pic16/crt0i.o"

cat a.c

int test;
void main() {
test = 0;
}

SDCC :
mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08
2.5.4 #1191 (Jan 13 2006) (UNIX)

Discussion

  • Raphael Neider

    Raphael Neider - 2006-01-17
    • milestone: --> 100455
    • labels: --> 608414
    • status: open --> open-invalid
     
  • Raphael Neider

    Raphael Neider - 2006-01-17

    Logged In: YES
    user_id=1115835

    This is no bug, its a feature:
    The pic16 port allows you to specify the location of your
    call-stack via pragmas. Use a line like
    #pragma stack 0x300 0xff
    to place your stack at [0x300..0x3ff], initial stack pointer
    will be 0x3ff, our stack grows downwards.
    This specification is required exactly once per project.

    And, yes: I should go and implement some default behaviour
    to suppress this error... as soon as I get an idea, i do it.
    BTW: This is documented behaviour, ever seen the SDCC Manual?

    Raphael

     
  • Richard Deeley

    Richard Deeley - 2006-01-17

    Logged In: YES
    user_id=634964

    Yes, I did see the manual. Spent some time looking for this
    specific information as well as a web search for these
    keywords. Without success, needless to say. Well, like the
    HHGG, I guess I should have found it.

    Thanks for the info.

     
  • Vangelis Rokas

    Vangelis Rokas - 2006-03-06
    • assigned_to: nobody --> vrokas
    • status: open-invalid --> open-accepted
     
  • Vangelis Rokas

    Vangelis Rokas - 2006-04-08

    Logged In: YES
    user_id=770505

    The idea is to have a small object that will allocate
    enough space for stack. This file will be placed in
    libsdcc.lib which is always used when SDCC links objects.
    The result will be the following, if the user has supplied
    a stack directive in the main() file then the linker will
    see _stack_end symbol and use that, otherwise it will have
    to load the symbol from the library.

    This approach eliminates the missing symbol error, but
    certainly will prevent users from understanding what's
    happening with stack and stack size.

    Would anyone disagree with this?

     
  • Maarten Brock

    Maarten Brock - 2006-04-08
    • milestone: 100455 -->
    • labels: 608414 -->
     
  • Maarten Brock

    Maarten Brock - 2006-04-08

    Logged In: YES
    user_id=888171

    Vangelis,

    This looks like a perfect solution. The understanding by
    the users will have to come from good documentation.

    I may seem pedantic about this, but I do not consider this
    a bug. It is documented behaviour as it is right now and
    your proposal is a very nice new feature. Therefor I move
    this to feature requests.

    Maarten

     
  • Philipp Klaus Krause

    • labels: --> pic16 target
    • status: open-accepted --> open
     

Log in to post a comment.