[PATCH] D52430: =Issue a warning when IFUNC symbols are used and text relocations are allowed. This is because it produces a binary that seg faults when the object file is linked with glibc. The warning is contingent on a command line flag (default is false)...
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 24 12:28:56 PDT 2018
ruiu added inline comments.
================
Comment at: ELF/Driver.cpp:832
Config->WarnCommon = Args.hasFlag(OPT_warn_common, OPT_no_warn_common, false);
+ Config->WarnIFuncTextRel =
+ Args.hasFlag(OPT_warn_ifunc_textrel, OPT_no_warn_ifunc_textrel, false);
----------------
A new variable name need to be consistent with other variables around it. In this case, all variable names are named after their corresponding command line flags, and the capitalization rule is to make a letter after "_" uppercase and then remove "_".
================
Comment at: ELF/Relocations.cpp:986
+ if (!Config->ZText && Config->WarnIFuncTextRel) {
+ warn("Using IFUNC symbols when text relocations are allowed may produce "
+ "a binary that will segfaults, if the object file is linked with "
----------------
Error messages need to be consistent -- please look other code when you are writing new code, so that new code looks the same as the other code. All other error messages start with a lowercase letter, and if they are followed by a source location, they end with ":".
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D52430
More information about the llvm-commits
mailing list