[llvm-bugs] [Bug 46480] New: [AArch64] .note.gnu.property always generated for object file without code
via llvm-bugs
llvm-bugs at lists.llvm.org
Sat Jun 27 10:16:20 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=46480
Bug ID: 46480
Summary: [AArch64] .note.gnu.property always generated for
object file without code
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: keescook at chromium.org
CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
neeilans at live.com, richard-llvm at metafoo.co.uk
The .note.gnu.property is generated even when -mbranch-protection=none is used,
on a source file that only has data (no code).
$ cat foo.c
int global = 5;
$ clang --target=aarch64-linux-gnu -c -o foo.o foo.c
$ readelf -n foo.o
Displaying notes found in: .note.gnu.property
Owner Data size Description
GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
Properties: AArch64 feature: BTI, PAC
$ clang --target=aarch64-linux-gnu -mbranch-protection=none -c -o foo.o foo.c
$ readelf -n foo.o
Displaying notes found in: .note.gnu.property
Owner Data size Description
GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
Properties: AArch64 feature: BTI, PAC
$ aarch64-linux-gnu-gcc -c -o foo.o foo.c
$ readelf -n foo.o
$ aarch64-linux-gnu-gcc -mbranch-protection=bti -c -o foo.o foo.c
$ readelf -n foo.o
Displaying notes found in: .note.gnu.property
Owner Data size Description
GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
Properties: AArch64 feature: BTI
$ cat bar.c
int code(void) { return 5; }
$ clang --target=aarch64-linux-gnu -c -o bar.o bar.c
$ readelf -n bar.o
$ clang --target=aarch64-linux-gnu -mbranch-protection=bti -c -o bar.o bar.c
$ readelf -n bar.o
Displaying notes found in: .note.gnu.property
Owner Data size Description
GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
Properties: AArch64 feature: BTI
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200627/e218e653/attachment-0001.html>
More information about the llvm-bugs
mailing list