[an error occurred while processing this directive]
Ответ: Может быть это поможет.
(«Телесистемы»: Конференция «Микроконтроллеры и их применение»)
миниатюрный аудио-видеорекордер mAVR

Отправлено Bill 24 июля 2002 г. 14:10
В ответ на: Проблема с Hi-Tech. Как это перевести на удобоваримый язык?(+) отправлено АГ 23 июля 2002 г. 18:26

34. How do I locate "Fixup error" messages?


Q: I get the message "Fixup error referencing ..."; or "Fixup error in expression ..."
What does this mean and what can I do about it?

A: Briefly, it means the linker was instructed to adjust (fixup) a reference
to a memory location, and the address that it calculated would not fit in the
space available, e.g. a byte (8 bit) reference was asked to contain a value
larger than 0xFF.

Typically this occurs with the PICC compiler where pointers have not
correctly been declared. For example:

bank2 char ch;
char *ptr;

ptr = &ch; // fixup error

This is a fixup error because "ptr" is a bank0 pointer - it needs to
be bank2. ie:

bank2 char *ptr;


To locate the cause of the fixup error, look at the error message.
Here's an example:

gmain6.obj:113:Fixup overflow referencing psect rbss_1 (loc 0x8C8 (0x8C2+6), size 1, value 0xA8)

This is from the PIC compiler. The "size" tells us it's a one byte reference -
in fact it's a 7 bit data reference, hence the value 0xA8 is too big to fit.
The fact that it references rbss_1, which is a bank1 address, suggests that
a reference was being made to bank 1 without truncating the full address to
the 7 bits that actually fit in the instruction.

Note the location - 0x8C8. This is the absolute address of the offending instruction;
make sure you have generated an assembler list file, and edit it. The address given
is a byte address, but because this is on a PIC which has 14 bit wide
program memory, divide by two to get a word address - 8C8/2 = 0x464.
On other processors the address would be used directly.

In the list file, simply locate location 0x464:

993 0464 00A8 movwf _TempChar ;#
^^^^ location

The value given in the error message (0xA8) is the address of TempChar - you can also
check the map or symbol file to find a symbol with this address (but the list file
method is probably better).

If you're using a compiler that doesn't give you an absolute list file, it's a
little harder. In this case use the dump utility to dump the object file. The
number after the file name is the record number - 113. Do something like this:

dump gmain6.obj >afile

Now edit afile and look for 113:

113 RELOC 506
0 RELBITS COMPLEX 11
(0x2DB+text0)-(text0&0xFFFFF800)
6 RELBITS RPSECT rbss_1 7

Here is the info we need - note the offset of 6 from the start of this
record - that corresponds to the +6 in the location of the error. To
relate this to an address, look at the immediately preceding text record
(112 in this case, sometimes there will be two reloc records for one
text record):

112 TEXT 98
text0 1478 88

The "text 0 1478" says this is the text0 psect, and this block starts
at offset 1478 (decimal) from the start of the text0 psect in this module.
Add the 6 byte in-block offset to get 1484, convert to hex, 0x5CC, now
divide by two for a PIC (use as is for other chips) to get 2E6, and check
the (relocatable) list file:

993 02E6' 0088' movwf _TempChar ;#

There it is. The same line as in the absolute list file, but unrelocated.
In this case, this is embedded assembler code (the ;# indicates this) and
it should read something like this:

bsf 3,5 ;set RP0 to access bank 1
movwf _TempChar^0x80 ; invert top bit of address



Составить ответ  |||  Конференция  |||  Архив

Ответы



Перейти к списку ответов  |||  Конференция  |||  Архив  |||  Главная страница  |||  Содержание  |||  Без кадра

E-mail: info@telesys.ru