[cfe-dev] AArch64 ASM / Custom Sections and Common Variables

Joel Winarske via cfe-dev cfe-dev at lists.llvm.org
Sat Nov 9 10:25:56 PST 2019


What is the proper way to have a variable common between two custom-defined
sections?

Example:

  .global foo1
  .section .text.foo1, "ax"
foo1:
  ldr w0, FooValue
  ret

  .global foo2
  .section .text.foo2, "ax"
foo2:
  ldr w0, FooValue
  ret

FooValue: .word 0x00

This generates "unsupported relocation type:
fixup_aarch64_ldr_pcrel_imm19".  If I comment out the first ldr line, it
builds, as FooValue is part of .text.foo2.

If I define FooValue twice, once for each section it complains it's already
defined.


Joel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20191109/91a8d271/attachment.html>


More information about the cfe-dev mailing list