Hello. Is there any way to simplify the call tree manipulation in linker..? (Scripting kind of) My code has number of function calls through pointers. The functions are divided in few main groups. I want to achieve overlay among the functions of an individual group.(Intragroup) At the same time I want to avoid overlaying among the functions from different groups.(Intergroup) Adding and removing the references for every function from every other function is big task. I somehow managed it at the moment. However it is not good practice from the long term perspective.
So, can I define a list of functions which can be used at multiple places in linker script. Or can I share a macro from compiler to the linker..?
Best regards, Vivek.
Have you read the Application Notes and knowledgebase articles about using function pointers in C51?
They will point you to the Linker Controls for manipulating the call tree...
A forum search would also be a good idea...
But is it really worth it? Would not the effort be better spent in designing for an architecture where all this stuff is just not an issue?!
Sorry, I forgot to mention. Redesigning architecture is not an option. My system requirements will always result in multiple function calls through pointers. No matter how I design it. Besides, changing design architecture for tool set...mmm...sounds strange. Expecting from tool set an easy way to manipulate the call tree, sounds more obvious and practical. What do you think..? So please let me know if there is any way to group the functions in linker; Or I have to live with the situation..?
Thanks for your help.
Best regards, Vivek
Here the method to manager this kind of stuff is to use scripts/apps to analyze the source and linker outputs (.MAP, .OBJ, .LIB, etc) and automate tasks which the computers were designed for. The output from such a process might include make files, and auto-generated source files, along with call tree and working set analysis.
Hey.
You shud go to my forum.
the site its got loads of cool information about the 51 and a huge community of real talented professionals.
check the stats. its real big and growing.
just use the search bar and ask the question. some of the search engine is controlled by a matrix of 51s.
"My system requirements will always (sic?) result in multiple function calls through pointers"
Really?
When I looked at this, I concluded that the chances of getting manual calltree manipulation all correct - and maintaining it that way - were slim. So I redesigned the code to not use function pointers. It wasn't hard.
But, if you really must use function pointers, have you studied the app note - it shows you how it can be done without having to manipulate the calltree.
You do realise, don't you, that this is all due to a fundamental limitation of the 8051 hardware architecture - so, if function pointers really are so essential to you, you have really chosen the wrong target architcture!
"Expecting from tool set an easy way to manipulate the call tree, sounds more obvious and practical"
Well, there's only so far you can bend an inappropriate architecture...
You can sometimes get away with using a hammer to drive screws - but expecting hammer makers to adjust their designs to better drive screws is solving the wrong problem...
Redesigning architecture is not an option. My system requirements will always result in multiple function calls through pointers. I'm calling BS on that assessment.
Function pointes are often the most obvious and convenient way to express a design. But they're never actually necessary. Every call through a function pointer can instead be expressed by a switch() construct calling one of the applicable functions in question, if need be.
No matter how I design it. Then maybe you need to learn more about either a) design techniques suitable for smallish controllers, or b) picking the right class of controller for the job.
Hey dude.
Why don't you admit you don't know what your talking about?
Just do it properly.
H Burger MSt
>> a huge community of real talented professionals
If my experience with forums counts for much I'd expect several orders of magnitude more members fall into the talentless pool.
I can't fail to admire a forum so professional that the person boasting it's virtues finds it unnecessary to mention the name of that forum.
View all questions in Keil forum