1

now that Apple's platforms finally made a decision about architectures, I am starting to learn arm64 assembly on Darwin, and I don't find any information how to load addresses in the .data section.

On Linux, this works:

ldr X1, =symbol

.data
symbol:      .ascii  "foo"

Apple has an article why this does not work for Mach-O binaries, and how it is done on x86 with @GOTPCREL, but that does not tell me how the Clang assembler handles this on Apple Silicon. (Putting the data into the .text section does not help, because I need it to be writable)

Any information is appreciated!

Paul R
  • 208,748
  • 37
  • 389
  • 560
below
  • 929
  • 6
  • 26

1 Answers1

0

It would appear that I need to use ADRP Rx, symbol@GOTPAGE. Still, any more insight is appreciated

below
  • 929
  • 6
  • 26