Go to file
Fangrui Song 025a815d75 [ELF] Make the rule to create relative relocations in a writable section stricter
The current rule is loose: `!Sym.IsPreemptible || Expr == R_GOT`.

When the symbol is non-preemptable, this allows absolute relocation
types with smaller numbers of bits, e.g. R_X86_64_{8,16,32}. They are
disallowed by ld.bfd and gold, e.g.

    ld.bfd: a.o: relocation R_X86_64_8 against `.text' can not be used when making a shared object; recompile with -fPIC

This patch:

a) Add TargetInfo::SymbolicRel to represent relocation types that resolve to a
symbol value (e.g. R_AARCH_ABS64, R_386_32, R_X86_64_64).

  As a side benefit, we currently (ab)use GotRel (R_*_GLOB_DAT) to resolve
  GOT slots that are link-time constants. Since we now use Target->SymbolRel
  to do the job, we can remove R_*_GLOB_DAT from relocateOne() for all targets.
  R_*_GLOB_DAT cannot be used as static relocation types.
b) Change the condition to `!Sym.IsPreemptible && Type != Target->SymbolicRel || Expr == R_GOT`.

Some tests are caught by the improved error checking (ld.bfd/gold also
issue errors on them). Many misuse .long where .quad should be used
instead.

Reviewed By: ruiu

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

llvm-svn: 363059
2019-06-11 12:59:30 +00:00
clang [RISCV][NFC] Add missing test files for D54091 2019-06-11 12:49:15 +00:00
clang-tools-extra [clang-tidy] Fix typo in bugprone-string-constructor. 2019-06-11 12:12:06 +00:00
compiler-rt [compiler-rt] Update comments in asan header to doxygen format; NFC. 2019-06-11 08:59:46 +00:00
debuginfo-tests Add cdb test for global constants 2019-06-06 20:23:05 +00:00
libclc travis: Add LLVM-8 build 2019-03-27 21:28:31 +00:00
libcxx Add a test for is_base_of and incomplete types. Because this trait uses a compiler intrinsic which was broken in many clangs, have lots of XFAILs. 2019-06-11 03:38:29 +00:00
libcxxabi [demangle] Vendor extended types shouldn't be considered substitution candidates 2019-06-10 21:02:39 +00:00
libunwind [Docs] Modernize references to macOS 2019-05-30 16:46:22 +00:00
lld [ELF] Make the rule to create relative relocations in a writable section stricter 2019-06-11 12:59:30 +00:00
lldb [Target] Use llvm::scope_exit to restore m_suppress_stop_hooks value. 2019-06-10 21:13:37 +00:00
llgo IR: Support parsing numeric block ids, and emit them in textual output. 2019-03-22 18:27:13 +00:00
llvm [RISCV] Add lowering of addressing sequences for PIC 2019-06-11 12:57:47 +00:00
openmp Added propagation of not big initial stack size of master thread to workers. 2019-06-05 16:14:47 +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 [ScheduleTreeTransform] Silence compiler warning. NFC. 2019-06-06 17:15:36 +00:00
pstl [pstl] The optimized parallel versions of sort, stable_sort algorithms, TBB parallel backend. 2019-06-06 07:34:46 +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 Add a reduced copy of the llvm .gitignore 2019-04-09 00:52:49 +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.