Skip to content

Commit

Permalink
[PR] Update skipRelocationProcess
Browse files Browse the repository at this point in the history
Summary:
The ELF::R_AARCH64_TLSDESC_LD64_LO12 and
ELF::R_AARCH64_TLSDESC_ADR_PAGE21 relocations might also be relaxed to
mov instructions, handle these cases

Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei

(cherry picked from FBD31353063)
  • Loading branch information
yota9 authored and maksfb committed Oct 1, 2021
1 parent c637fcf commit 848f077
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion bolt/src/Relocation.cpp
Expand Up @@ -178,11 +178,13 @@ bool skipRelocationProcessAArch64(uint64_t Type, uint64_t Contents) {
// to initial exec), thus changing the instructions. The static
// relocations might be invalid at this point and we might no
// need to proccess these relocations anymore.
// More information could be find by searching
// More information could be found by searching
// elfNN_aarch64_tls_relax in bfd
switch (Type) {
default:
break;
case ELF::R_AARCH64_TLSDESC_LD64_LO12:
case ELF::R_AARCH64_TLSDESC_ADR_PAGE21:
case ELF::R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
case ELF::R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21: {
if (IsMov(Contents))
Expand Down
1 change: 0 additions & 1 deletion bolt/test/AArch64/tls.c
Expand Up @@ -24,7 +24,6 @@ int main() {
}

// REQUIRES: system-linux
// XFAIL: *
// RUN: %clang %cflags -no-pie %s -o %t.exe -Wl,-q \
// RUN: -Wl,--unresolved-symbols=ignore-all \
// RUN: -target aarch64-linux -fuse-ld=ld.lld \
Expand Down

0 comments on commit 848f077

Please sign in to comment.