AnsweredAssumed Answered

Accessing .ldf symbols

Question asked by STWisdom on Jun 22, 2011
Latest reply on Jun 23, 2011 by STWisdom

Hi there!

I am writing software for a Blackfin BF525. I am implementing some code where I would like to get the address of the beginning of the memory region allocated to the stack. What I tried initially was to access the symbols ldf_stack_space and ldf_stack_end from a C source file by including the lines


extern "asm" int ldf_stack_space;

extern "asm" int ldf_stack_end;


at the top of my C file below the include directives. However, when I try to make an assignment in a function, i.e.


void function1()


     int stackPointer;

     stackPointer = ldf_stack_space;




, stackPointer is not getting the value of ldf_stack_space. Now, I have been looking through documentation on how I might be able to access the .ldf symbols in my source code. I am certainly able to access the symbols in my startup code, basiccrt.s, by using the directive .extern ldf_stack_space. I also tried including the lines


.global ldf_stack_space


in the basiccrt.s file in a user-code preserving section, but still no dice. I have also tried adding mangled names to the .ldf by including this code in the user-code preserving section:


_ldf_stack_space = ldf_stack_space;

_ldf_stack_end = ldf_stack_end;


So, is it even possible to access .ldf symbols in source code? If so, how?

Thank you very much!