HomePhabricator

[lld-macho] Support __dso_handle for C++

Authored by int3 on Jul 30 2020, 2:28 PM.

Description

[lld-macho] Support __dso_handle for C++

The C++ ABI requires dylibs to pass a pointer to __cxa_atexit which does
e.g. cleanup of static global variables. The C++ spec says that the pointer
can point to any address in one of the dylib's segments, but in practice
ld64 seems to set it to point to the header, so that's what's implemented
here.

Reviewed By: #lld-macho, smeenai

Differential Revision: https://reviews.llvm.org/D83603

Details

Committed
int3Jul 30 2020, 2:28 PM
Reviewer
Restricted Project
Differential Revision
D83603: [lld-macho] Support __dso_handle for C++
Parents
rG9ebeac678855: [ConstantRange][CVP] Make use of abs poison flag
Branches
Unknown
Tags
Unknown