I am using a "trick" to simulate __attribute__(at()) from the ARM toolchain in GCC. I have a macro defined as
#define __AT(name, addr) asm(".equ " #name ", " #addr)
Then I have something like the following:
extern volatile struct SomeStruct_t thing; __AT(thing, 0xa0000000);
When I use this with compilers targeted at arm-none or arm-elf, it works fine and I get the desired result that I can access the "thing" structure instance and it accesses the correct memory location.
However, when I use this with aarch64-none or aarch64-elf compilers, I get the following:
C:\msys64\tmp\cc8js1P1.s: Assembler messages:
C:\msys64\tmp\cc8js1P1.s: Internal error in md_apply_fix at /tmp/dgboter/bbs/dsggnu-vm-1-x86_64--mingw32-i686/buildbot/mingw32-i686--aarch64-elf/build/src/binutils-gdb/gas/config/tc-aarch64.c:8095.
Please report this bug.
Is anyone aware of any workaround that would me to achieve the result I am looking for? I do not have the option of modifying the linker script for this.
Wouldn't it just be better done by the Linker ... ?
Ideally it would be nice, but I have several of these definitions that can change from product to product which is why I am doing it this way. Having to do this via the linker script would make it very cumbersome to users in my system.
I don't really see how doing it in the linker script is any more or less cumbersome.
The general GCC documentation lists an 'address' attribute for some architectures (eg, AVR), but has no mention of ARM at all
Maybe ARM GCC does have it, but documented elsewhere ... ?
I'll take a look at that. Thanks.
View all questions in GNU Toolchain forum