Alexey Moksyakov 1fb186198a adds huge pages support of PIE/no-PIE binaries
This patch adds the huge pages support (-hugify) for PIE/no-PIE
binaries. Also returned functionality to support the kernels < 5.10
where there is a problem in a dynamic loader with the alignment of
pages addresses.

Differential Revision: https://reviews.llvm.org/D129107
2022-11-04 15:14:21 +03:00

28 lines
575 B
C

// Make sure BOLT correctly processes --hugify option
#include <stdio.h>
int main(int argc, char **argv) {
printf("Hello world\n");
return 0;
}
/*
REQUIRES: system-linux,bolt-runtime
RUN: %clang %cflags -no-pie %s -o %t.nopie.exe -Wl,-q
RUN: %clang %cflags -fpic -pie %s -o %t.pie.exe -Wl,-q
RUN: llvm-bolt %t.nopie.exe --lite=0 -o %t.nopie --hugify
RUN: llvm-bolt %t.pie.exe --lite=0 -o %t.pie --hugify
RUN: %t.nopie | FileCheck %s -check-prefix=CHECK-NOPIE
CHECK-NOPIE: Hello world
RUN: %t.pie | FileCheck %s -check-prefix=CHECK-PIE
CHECK-PIE: Hello world
*/