Descriptionsandbox: Remove a TEXTREL on Linux ARM.
On Android, the sandbox logic is put into a shared library and the linker errors
out on having a TEXTREL.
The LDR pseudo-instruction directs the assembler to place the address of the
label in a "literal pool"[1], and then use a PC-relative load from that pool to
get the address during execution. The pool is responsible for generating
the R_ARM_RELATIVE TEXTREL.
Using the ADR instruction[2] does not produce the TEXTREL. This instruction
directs the assembler to calculate the PC-relative address to the label using an
immediate.
The text makes this difference more clear:
...
8: 4805 ldr r0, [pc, #20] ; (20 <SyscallAsm+0x20>)
a: e007 b.n 1c <SyscallAsm+0x1c>
...
1c: bd80 pop {r7, pc}
1e: 0000 .short 0x0000
20: 0000001c .word 0x0000001c
Versus:
...
8: 4804 ldr r0, [pc, #16] ; (1c <SyscallAsm+0x1c>)
a: e007 b.n 1c <SyscallAsm+0x1c>
...
1c: bd80 pop {r7, pc}
1e: bf00 nop
[1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0041c/Babbfdih.html
[2] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0040d/Cihdhgbe.html
BUG=308763
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=242141
Patch Set 1 #
Messages
Total messages: 6 (0 generated)
|