freebsd-dev/contrib/llvm-project
Alex Richardson 80500f4ed6 Merge commit 894f742acb from llvm git (by me):
[MIPS][ELF] Use PC-relative relocations in .eh_frame when possible

  When compiling position-independent executables, we now use
  DW_EH_PE_pcrel | DW_EH_PE_sdata4. However, the MIPS ABI does not define a
  64-bit PC-relative ELF relocation so we cannot use sdata8 for the large
  code model case. When using the large code model, we fall back to the
  previous behaviour of generating absolute relocations.

  With this change clang-generated .o files can be linked by LLD without
  having to pass -Wl,-z,notext (which creates text relocations).
  This is simpler than the approach used by ld.bfd, which rewrites the
  .eh_frame section to convert absolute relocations into relative references.

  I saw in D13104 that apparently ld.bfd did not accept pc-relative relocations
  for MIPS ouput at some point. However, I also checked that recent ld.bfd
  can process the clang-generated .o files so this no longer seems true.

  Reviewed By: atanasyan
  Differential Revision: https://reviews.llvm.org/D72228

Merge commit 8e8ccf47 from llvm git (by me)

  [MIPS] Don't emit R_(MICRO)MIPS_JALR relocations against data symbols

  The R_(MICRO)MIPS_JALR optimization only works when used against functions.
  Using the relocation against a data symbol (e.g. function pointer) will
  cause some linkers that don't ignore the hint in this case (e.g. LLD prior
  to commit 5bab291) to generate a relative branch to the data symbol
  which crashes at run time. Before this patch, LLVM was erroneously emitting
  these relocations against local-dynamic TLS function pointers and global
  function pointers with internal visibility.

  Reviewers: atanasyan, jrtc27, vstefanovic
  Reviewed By: atanasyan
  Differential Revision: https://reviews.llvm.org/D72571

These two changes should allow using lld for MIPS64 (and maybe also MIPS32)
by default.
The second commit is not strictly necessary for clang+lld since LLD9 will
not perform the R_MIPS_JALR optimization (it was only added for 10) but it
is probably required in order to use recent ld.bfd.

Reviewed By:	dim, emaste
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D23203
2020-01-16 14:14:50 +00:00
..
clang [PowerPC64] Starting from FreeBSD 13.0, default to ELFv2 ABI 2019-12-27 04:00:04 +00:00
compiler-rt [PowerPC] enable atomic.c in compiler_rt and do not check and forces 2019-12-26 23:06:28 +00:00
libcxx Merge commit f97936fab from llvm git (by Eric Fiselier): 2019-12-22 11:58:44 +00:00
libunwind revert r356513: libunwind: untested attempt to fix sparc64 build 2020-01-09 14:10:11 +00:00
lld Merge commit 189b7393d from llvm git (by John Baldwin): 2020-01-03 20:29:54 +00:00
lldb Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp 2019-12-22 11:50:44 +00:00
llvm Merge commit 894f742acb from llvm git (by me): 2020-01-16 14:14:50 +00:00
openmp Consolidate FREEBSD-Xlist files of different llvm sub-projects into one. 2019-12-20 21:42:10 +00:00
FREEBSD-Xlist Consolidate FREEBSD-Xlist files of different llvm sub-projects into one. 2019-12-20 21:42:10 +00:00