2

Looking into a disassembly code, I saw the instructions like:

adrp x8,l066@PAGE
add x8,x8,l066@PAGEOFF

Are they the offset labels being defined somewhere? And how to find the value of them?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Kobayashi
  • 143
  • 1
  • 13
  • 2
    Might they just be the [relocation types](https://stackoverflow.com/questions/38570495/aarch64-relocation-prefixes/38608738#38608738)? – Margaret Bloom Aug 02 '16 at 08:08

2 Answers2

2

@page and @pageoff are assembler directives to calculate the offset at link time. @page takes the position independent 4k page offset of the symbol and uses the PC to convert it into an absolute page address. @pageoff gives the offset into the page that the symbol is located. Together they are able to generate a 64-bit address in a position-independent way.

Variable Length Coder
  • 7,958
  • 2
  • 25
  • 29
  • 1
    So, is it possible to find them by ida or hopper? I mean not by the way of examining them at runtime. – Kobayashi Aug 03 '16 at 02:32
0

I've not seen that disassembly style before, but I'd automatically assume that l066 is a label that the disassembler has inferred, for which it is also annotating the appropriate relocations as Margaret says. In other words, it's effectively adrl x8, l066.

Community
  • 1
  • 1
Notlikethat
  • 20,095
  • 3
  • 40
  • 77