boringssl/util/fipstools/testdata/ppc64le-TOCWithOffset/in.s
Adam Langley cd334a54ca Handle TOC offsets by giving them to the linker.
An offset > 2^15 would exceed the range of an addi immediate on ppc64le.
Thus, rather than add the offset after loading the TOC reference, have
different tocloader functions for each (symbol, offset) pair. In this
case, the linker can handle large offsets by changing the value of
foo+offset@toc@ha accordingly.

Change-Id: Iac1481bccaf55fb0c2b080eedebaf11befdae465
Reviewed-on: https://boringssl-review.googlesource.com/16784
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: David Benjamin <davidben@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2017-06-01 21:29:23 +00:00

18 lines
302 B
ArmAsm

.text
foo:
# TOC references may have offsets.
addis 3, 2, 5+foo@toc@ha
addi 3, 3, 10+foo@toc@l
addis 3, 2, 15+foo@toc@ha
addi 3, 3, 20+foo@toc@l
addis 4, 2, foo@toc@ha
addi 4, 4, foo@toc@l
addis 5, 2, 5+foo@toc@ha
ld 5, 10+foo@toc@l(5)
addis 4, 2, foo-10@toc@ha
addi 4, 4, foo-10@toc@l