DDE Linker
Steven Fink (12146) 6 posts |
Can anybody explain the DDE Linker error: Relocated value too big for instruction sequence? This error crops up frequently and I have managed to get around it up to this point by renaming the area names of code that resides in different files. But I have no idea what the error means exactly, and the DDE documentation does not discuss it. |
David Pitt (9872) 363 posts |
A search of the forum with that error finds two previous instances, which may or may not help. One and two |
Paolo Fabio Zaino (28) 1882 posts |
@ Steven I haven’t experienced this in recent years, so memory-based debug fails to help me, however, few things to think about: - Are you using Thumb instructions or switching to Thumb mode? Any of the above may lead to the error you are receiving, but without more details about your code, it’s hard to figure out what is going on, sorry. |
Matthew Phillips (473) 721 posts |
I don’t do much assembly language, but it sounds like the assembler has been unable to build an address of a label. If you use ADR, for example, the assembler will attempt to produce the address of the label relative to the program counter (R15) by using the ARM instructions it has available, such as ADD and SUB. The constants that can be generated in a single-word instruction are limited to eight bits with up to 15 bits of shift, so it is possible to access addresses quite a long way off if the distance happens to be a round binary number. If it cannot fit into a single word, you will have to use ADRL, which compiles the generation of a relative address using two instructions, I think. You have to choose which to do, because assembler is not free to alter the number of instructions generated. |
Steven Fink (12146) 6 posts |
Mr. Fabio, |
David J. Ruck (33) 1635 posts |
You might be using an explicit ADR, but something is doing a PC relative ADD/SUB or LDR/STR with an immediate offset, the assembly output should show that. The documentation for DDE was probably written before many of your many years of programming. Back then we were bloody grateful for anything that produced code, and were willing to work out how it worked ourselves. |