SuperH literal pools in gas
Oleg Endo
olegendo1024@gmail.com
Thu Apr 9 02:19:30 GMT 2026
Hi!
On Thu, 2026-04-09 at 02:46 +0100, Joseph Matthews wrote:
> Hi all,
>
> I'm looking to move something using Renesas' SuperH assembler to gas, however
> it doesn't seem as if there's an equivalent to its literal pool functionality.
>
> Currently, I'm able to write something like "mov.l #imm, rn", which would be
> expanded to "mov.l @(disp, pc), rn" with a literal pool being placed after an
> unconditional branch or where a ".pool" directive has been placed, but it
> doesn't appear gas has this for SuperH.
>
> (sp is also not an alias to r15, but that can be worked around.)
>
> It appears ARM and other ISAs have this though, through writing something like
> "ldr reg, =imm" and using the ".ltorg" directive (or ".pool" synonym).
>
> Would there be any interest in implementing this for SuperH?
There isn't much active development on the SH parts. Last time somebody
tried to look into the -mrelax issue (to convert jmp/jsr into bra/bsr during
linking) discovered a bunch of issues, see also
https://sourceware.org/bugzilla/show_bug.cgi?id=3298
That being said, if you want to add .pool support, please feel free to do
so. I don't think there will be a reason to not accept it upstream. The
issues mentioned above may or may not get in your way though.
Literal pool handling is done in the compiler (GCC) in its own way.
Although it's the same problem for SH and ARM, unfortunately the solutions
are implemented differently in each backend, without using .pool directive.
I'm wondering if there could be any advantage of pushing the literal pool
handling from the compiler down to the assembler?
Best regards,
Oleg Endo
More information about the Binutils
mailing list