Odd linker problem

Hi,

I am adapting an existing project based on the ST10 chip. I am adding new data processing functions which are sat along side exisiting functions. Each function uses a unique data structure, therefore there is a TYPEDEF STRUCT for each function. The structures are defined in a corresponding header file. The project was working fine, until I got hold of it.

I added three new functions with their corresponding structures being added to the header file. All was well. Then I added a forth function. It compiled okay but then the linker threw a warning stating that a segment size had been set to less than zero by the SEGSIZE directive. The problem is the segsize directive has not been given to the linker.

After some messing about it became clear it was the amount of code and / or the number of TYPEDEF STRUCT occurances and not the latest function that was causing this problem.

I can get the build to complete but the target is malfunctioning and it looks like the pointer into the structure is mis-aligned.

I managed to strink the program until it would build without error, then preserved the M66 file. Then I increased the code size until it threw the warning. As this was by simply adding another TYPEDEF STRUCT statement, which had no variables declared to it, the actual code was functionally unchanged. I then compared the good and bad M66. About 10% throught the file the statement IGNORED STATEMENTS: was the only different.

Our great software engineer minds are all baffled by this one. We are using version 3.21.

Anyone got any ideas why this is happening and what to do to correct this?

Many thanks,

Dave

More questions in this forum