Hi there,
I am currently seeing a relatively strange occurrence with the Keil compiler and linker overlapping two pieces of code into the same code area without showing any warnings or errors to the user.
Here are the details:
* Compiler/Linker versions:
CX51 COMPILER V9.02 - SN: K1NCC-YA1WVE COPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 2010
LX51 LINKER/LOCATER V4.47a - SN: K1NCC-YA1WVE COPYRIGHT KEIL ELEKTRONIK GmbH 1995 - 2010
* Attached map file (linker_overlap.map), lines 651 - 653:
00CD88H 00CD93H 00000CH BYTE UNIT CODE_TIMER/B3 ?PR?_TIMER_INIT?TIMER *** OVERLAP *** 00CD89H 00CD95H 00000DH BYTE UNIT CODE/B3 ?L?COM000A
The linker is clearly overlapping two functions (timer_init and a linker optimized code block) in the same code space, causing timer_init to contain invalid code. It clearly detects it during linking, since it prints and *** OVERLAP *** message in the .map file, but it shows no errors or warnings.
* Additional details:
- Multiple libraries linked in with a mix of linker code packing enabled and disabled per library. - Warning level set to 2 in the .lin file (WARNINGLEVEL(2)) - Optimization level set to 9 (Common Block Subroutines) in all libraries
Thanks in advance!
Carles
a) We are linking against an .omf file which is a precompiled ROM 1) no .omf can exist in a ROM 2) if you have a .omf, you should have the source
Erik
1) no .omf can exist in a ROM
The .omf is not part of the ROM. When we build the ROM we generate an .omf file against which we link the full firmware release.
2) if you have a .omf, you should have the source
Yes, indeed, this is our own ROM. That code that is ROMed is frozen, and we continue developing the rest while linking with the ROM. The .omf is used to be able to link against the ROM without having to build its source again. The .omf contains the public symbols defined by the ROM and their location in code space.
... it generates them.
What am I missing?
Oh yes it does!
The Compiler generates its objects in OMF;
The Linker accepts OMF files as input, and can generate an OMF file as its output.
:)