This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: expanding addrs for initializers
> Correction: ".long f" is what you want to generate. It's not
> correct for (long)(short)&f.
The test program only has (long)&f in the C source. The (short) isn't
something I added myself; it's something gcc adds for me, which I
infer from the tree we end up with.
> Or doesn't sound like it; I'll note that while you gave an
> synopsis of the processor family, you didn't actually answer
> the specific question about the assembler and the relocation
> that it will emit.
m32c-elf does have a 32-bit relocation for symbol addresses. If GCC
gives the assembler ".long f" the assembler will emit an R_M32C_32
relocation (via BFD_RELOC_32) against f. If I hand-code this in
assembler, it works fine. The assembler can also handle ".short f"
with R_M32C_16 (via BFD_RELOC_16) and ".3byte f" with R_M32C_24 (via
BFD_RELOC_24). There's also a couple of hi/lo and pcrel relocs that
aren't relevent to this problem, and that's pretty much it for
m32c-elf relocs.