Go to file
Fangrui Song c6cd62352c [ELF] Simplify handling of exportDynamic and isPreemptible
In Writer::includeInDynSym(), exportDynamic is used by a Defined with
protected or default visibility, to record whether it is required to be
exported into .dynsym. It is set when any of the following conditions
hold:

1) There is an interposable symbol from a DSO (Undefined or SharedSymbol with default visibility)
2) If -shared or --export-dynamic is specified, any symbol in an object file/bitcode sets this property, unless suppressed by canBeOmittedFromSymbolTable().
3) --dynamic-list when producing an executable

4) protected symbol from a DSO preempted by copy relocation/canonical PLT when
  --ignore-{data,function}-address-equality is specified
5) ifunc is exported when -z ifunc-noplt is specified

Bullet points 4) and 5) are irrelevant in this patch.

Bullet 3) does not play well with 1) and 2). When -shared is specified,
exportDynamic of most symbols is true. This makes it incapable to record
--dynamic-list marked symbols. We thus have obscure:

    if (!config->shared)
      b->exportDynamic = true;
    else if (b->includeInDynsym())
      b->isPreemptible = true;

This patch adds another bit `Symbol::inDynamicList` to record
3). We can thus simplify handleDynamicList() by unifying the DSO and
  executable cases. It also allows us to simplify isPreemptible - now
the field is only used in finalizeSections() and later stages.

Reviewed By: peter.smith

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

llvm-svn: 368659
2019-08-13 09:12:52 +00:00
clang [NFC] Updated tests after r368657 2019-08-13 09:12:07 +00:00
clang-tools-extra [clang-doc] Generate HTML links for children namespaces/records 2019-08-12 18:42:46 +00:00
compiler-rt [TSan] Fix test failing on Linux 2019-08-13 00:37:48 +00:00
debuginfo-tests Make nrvo-string test more robust. 2019-06-27 20:38:37 +00:00
libclc Revert "Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC" 2019-08-05 17:23:23 +00:00
libcxx [libc++] Implement CTAD for std::tuple 2019-08-12 18:30:31 +00:00
libcxxabi small follow-up to r368604 2019-08-12 19:19:29 +00:00
libunwind [runtimes] Don't depend on libpthread on Android 2019-07-22 20:41:03 +00:00
lld [ELF] Simplify handling of exportDynamic and isPreemptible 2019-08-13 09:12:52 +00:00
lldb [Symbol] Remove redundant include 2019-08-13 00:25:49 +00:00
llgo IR: Support parsing numeric block ids, and emit them in textual output. 2019-03-22 18:27:13 +00:00
llvm [SimplifyLibCalls] Add dereferenceable bytes from known callsites 2019-08-13 09:11:49 +00:00
openmp Cleanup unused variable. 2019-08-12 12:37:30 +00:00
parallel-libs Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
polly [NFC][ScopBuilder] Move buildDomains and its callees to ScopBuilder. 2019-08-06 21:51:18 +00:00
pstl [NFC][pstl] Run clang-format 2019-08-08 17:10:45 +00:00
.arcconfig Update monorepo .arcconfig with new project callsign. 2019-01-31 14:34:59 +00:00
.clang-format Add .clang-tidy and .clang-format files to the toplevel of the 2019-01-29 16:43:16 +00:00
.clang-tidy Disable tidy checks with too many hits 2019-02-01 11:20:13 +00:00
.gitignore Change /build to /build* in top-level .gitignore. 2019-08-02 02:14:08 +00:00
README.md

README.md

The LLVM Compiler Infrastructure

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.