Linkerproblem (Inlinefunktion)

Gast #76956
Lesenswert?

Hallo,

habe mir von AVRFreaks, die DS1820 Library gezogen.
Beim linken kommt es dann zu folgendem Problem:

<schnippschnapp>
one_wire.o(.text+0x30): In function `ow_write_byte':
C:\dth\ulbc/one_wire.c:108: undefined reference to `_PC_'
one_wire.o(.text+0x30):C:\dth\ulbc/one_wire.c:108: relocation
truncated to fit: R_AVR_13_PCREL PC
one_wire.o(.text+0x4c):C:\dth\ulbc/one_wire.c:108: undefined
reference to `_PC_'
one_wire.o(.text+0x4c):C:\dth\ulbc/one_wire.c:108: relocation
truncated to fit: R_AVR_13_PCREL PC
one_wire.o(.text+0x64): In function `ow_read_byte':
C:\dth\ulbc/one_wire.c:127: undefined reference to `_PC_'
one_wire.o(.text+0x64):C:\dth\ulbc/one_wire.c:127: relocation
truncated to fit: R_AVR_13_PCREL PC
ds1820.o(.text+0x94): In function `ds1820_get_temp':
C:\dth\ulbc/ds1820.c:120: undefined reference to `_PC_'
ds1820.o(.text+0x94):C:\dth\ulbc/ds1820.c:120: relocation truncated
to fit: R_AVR_13_PCREL PC
ds1820.o(.text+0xe6):C:\dth\ulbc/ds1820.c:132: undefined reference to
`_PC_'
ds1820.o(.text+0xe6):C:\dth\ulbc/ds1820.c:132: relocation truncated
to fit: R_AVR_13_PCREL PC
make: *** [ulbc.elf] Error 1
</schnippschnapp>


Die LDFLAGS im Makefile sehen wie folgt aus :
LDFLAGS = -Wl,-Map=$(<:.o=.map),--cref -mmcu=$(MCU) -lm

Weiss jemand Rat, Jörg ich baue auf Dich....


Gruß
Dominic
Gast #76958
Lesenswert?

avr-gcc --version :
avr-gcc (GCC) 3.3.1
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

Zuallererst hatte ich natürlich ein make clean gemacht, welche mir alle
objects gelöscht hat.
Gast #76959
Lesenswert?

Irgendwas ist daran trotzdem noch foul.

Der Bug, der obiges verursacht hat, war nur kurze Zeit im AVR-GCC.
PC gibt's auch schon lange nicht mehr.

Mußt Du wohl selbst analysieren, wo das herkommt.  Vielleicht hat Dein
ds1820.c ja inline-asm, das so'n alten Kram noch versucht zu benutzen?
Gast #76960
Lesenswert?

Hallo Jörg,
Dein Tip war Goldrichtig :

#define DELAY_OW_RECOVERY_TIME()     {  _asm_ volatile("rjmp
_PC_+0"); _asm_ volatile("rjmp _PC_+0"); \
                                        _asm_ volatile("rjmp
_PC_+0"); _asm_ volatile("rjmp _PC_+0"); \
                                        _asm_ volatile("rjmp
_PC_+0"); _asm_ volatile("rjmp _PC_+0"); \
                                        _asm_ volatile("rjmp
_PC_+0"); _asm_ volatile("rjmp _PC_+0"); \
                                        _asm_ volatile("rjmp
_PC_+0"); _asm_ volatile("rjmp _PC_+0"); \
                                     }
Und das ist nur ein Teil wo der Müll rüberkommt.
Naja, also doch mal wieder selber das Rad neu erfinden und mal wieder
ne lib schreiben............

Danke und Gruß
Dominic

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren