Discussion:
lab 3 linking problem
(too old to reply)
luke dryden busler
2005-03-03 03:03:18 UTC
Permalink
lab3.o(.text+0x178):lab3.o: relocation truncated to fit: 13 .data+2c9
lab3.o(.text+0x198):lab3.o: relocation truncated to fit: 13 .data+2c9
lab3.o(.text+0x1b8):lab3.o: relocation truncated to fit: 13 .data+2c9
lab3.o(.text+0x1d8):lab3.o: relocation truncated to fit: 13 .data+2c9
When I looked at the ISEM FAQ/Help on the site, it said this could be
caused by something such as:
label: ...
mov label, %rd

The error then results because when things get shifted around after
assembling, the label address becomes too large to encode in the
instruction and then gets truncated. I don't have anything specifically
like that in my code, and since the errors don't really give me line
numbers from the source file, but apparently from the object file (I
think?), it's somewhat difficult for me to track down what's causing the
linking error. What operations besides mov can cause this type of error?


Thanks,
Luke
Wayne D. Heym
2005-03-03 03:15:40 UTC
Permalink
It's great that you checked the FAQ and did all that good thinking.
Excellent!
lab3.o(.text+0x178):lab3.o: relocation truncated to fit: 13 .data+2c9
since the errors don't really give me line numbers from the source
file, but apparently from the object file (I think?), it's somewhat
difficult for me to track down what's causing the linking error. What
operations besides mov can cause this type of error?
The listing file that comes form assembling can help you pinpoint the
location of this error. The second column from the left in the listing
file shows the offset. In the listing file at offset 0x178 (in the
listing file this shows as something like "00178"), you will see the
instruction that is causing this error. There are three more similar
errors in your program, corresponding to the three additional error
messages: 0x198, 0x1b8, and 0x1d8.
--
Wayne
Loading...