Hi Jennie,
The problem is that the object names (or even the number of objects) can not be known in advance, and ENTRIES does not appear to support anything except individual literal object names.
Here's the relevant header code:
typedef struct {
void (*func)(void);
unsigned char priority;
unsigned char unused[3];
} auto_start_t;
#define AUTO_START(x, y) const auto_start_t _auto_start_func_##x @ "AUTO_START" = {x, y}
And its use in one of the peripheral drivers:
void BMP085_Init(void);
AUTO_START(BMP085_Init, 4);
The desired result is this:
MODULE: -- bmp085_c.obj --
- PROCEDURES:
BMP085_Init 8854 5D 93 2 .text
- VARIABLES:
_auto_start_func_BMP085_Init F840 6 6 0 AUTO_START
For this example I added the _auto_start_func explicitly in the linker ENTRIES section:
ENTRIES
_auto_start_func_BMP085_Init
END
As you can see, if I add the entry manually it works and _auto_start_func_BMP085_Init is added to a list in section AUTO_START. The main application reads each entry in AUTO_START and executes the functions.
The problem is that I can find no way to accomplish this without explicitly adding each init function to the ENTRIES list, and having to do that entirely defeats the purpose of the mechanism. I need either an equivalent to the KEEP (*(.auto_start)) or REF_INCLUDE {.auto_start} commands that will work with the HCS08, a way to selectively disable smart linking, or a way to include a dummy function or other item that references the _auto_start function that will not itself be dead stripped.
Scott