Information Exchange between MAP file and Linker Command File (Linker Script)

Hi,

I do not find any option in Linker Script for passing values from another file to Linker Script. Is it there ? ( Did i miss it :( ?? ) I think, i will write my own Perl Script for extracting the used memory info from MAP file to find the remaining unused space and write that unused space at the corresponding location in the Linker Command File. But, if there is an option available with the Linker Command File programming for information exchange with MAP file, it would be really nice. Is it there ?

Below is the scenario : I need to tell application 'A' to use the unused space of application 'B' .

From the MAP file of application 'B', i know the amount of memory used

, but this info has to be told to application 'A'.

How to tell my Linker Command FIle (Linker Scripts) of application 'A' that the application 'B' has some amount of Unused memory in a certain region and so the application 'A' can use that memory ? That is , how to do information exchange between MAP file and Linker Script using Linker Script programming techniques ?

Thx in advans, Karthik Balaguru

Reply to
karthikbg
Loading thread data ...

Impossible for anyone other than you to tell, because you forgot to mention which linker's script language you're talking about.

And what on earth would you want to do that for?

The linker *creates* the map file. There's no reason for it to read it.

You don't. You configure the linker scripts for both applications to use separate memory spaces, and only worry about changing them if and when one of them overflows its quota.

Reply to
Hans-Bernhard Bröker

Why do you use separate linking for applications A and B ?

The last time I used separate linking was in the days of 8" floppies and 2 KiB EPROMs with 5 minute programming times :-).

Anyway, without knowing what linker you are using and if it supports generating of symbol table files, I would create a dummy module that only contains the definition of symbol ZZZZZZ and make sure that this module is loaded after all other modules in application B. Depending on the linker, the module would be loaded last simply by putting the module last in in the file list, by using a suitable file name, such as zzzzzz to put it last or using program section attributes. Consult your linker manual in which order the modules will be loaded.

The linker of application A should read the symbol table file to locate the symbol ZZZZZZ (or if everything else fails, search the map file from link B to find the symbol ZZZZZZ).

Paul

Reply to
Paul Keinanen

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.