[PATCH] D112595: [IRSymTab] Mark __stack_chk_guard used

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 27 21:16:27 PDT 2021


tejohnson added a comment.

In D112595#3092240 <https://reviews.llvm.org/D112595#3092240>, @ychen wrote:

> In D112595#3091582 <https://reviews.llvm.org/D112595#3091582>, @MaskRay wrote:
>
>>> `__stack_chk_guard` is a user-defined variable
>>
>> Can be more accurate. For some architectures glibc define the variable (https://sourceware.org/bugzilla/show_bug.cgi?id=26817)
>
> Yes, I've updated the summary.
>
>>> There are a couple other symbols handled specially in Internalize.cpp (stack_chk_fail, and ssp_canary_word for AIX), should the all be handled uniformly?
>>
>> Echo this request. Would'be great to make the logic centralized, but may not be in this patch if you think not fit.
>
> Hmm, I think the only place that needs this logic is IRSymTab; "RuntimeLibcalls.def" and Internalizer cover the rest of the use cases (ThinLTO, legacy LTO API).

Ok I follow now. The reason why legacy (Thin)LTO and new ThinLTO work is that they invoke Internalize.cpp to perform the internalization. However, regular LTO with the new LTO API performs internalization itself based solely on the symbol resolutions which derive from IRSymTab info.



================
Comment at: llvm/lib/Object/IRSymtab.cpp:44
 
 static const char *LibcallRoutineNames[] = {
 #define HANDLE_LIBCALL(code, name) name,
----------------
I think perhaps the name of this array and the variable it is used to set (IsBuiltinFunc) ought to change. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112595/new/

https://reviews.llvm.org/D112595



More information about the llvm-commits mailing list