freebsd-nq/contrib/llvm
Dimitry Andric 24ea14660b Pull in r369828 from upstream lld trunk (by Fāng-ruì Sòng):
[ELF] Align the first section of a PT_LOAD even if its type is
  SHT_NOBITS

  Reported at https://reviews.llvm.org/D64930#1642223

  If the only section of a PT_LOAD is a SHT_NOBITS section (e.g. .bss),
  we may not align its sh_offset. p_offset of the PT_LOAD will be set
  to sh_offset, and we will get p_offset!=p_vaddr (mod p_align).  If
  such executable is mapped by the Linux kernel, it will segfault.

  After D64906, this may happen the non-linker script case.

  The linker script case has had this issue for a long time.  This was
  fixed by rL321657 (but the test linkerscript/nobits-offset.s failed
  to test a SHT_NOBITS section), but broken by rL345154.

  Reviewed By: peter.smith

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

Pull in r371013 from upstream lld trunk (by Rui Ueyama):

  Align output segments correctly

  Previously, segments were aligned according to their first section's
  alignment requirements. That was not correct, but segments are also
  aligned to a page boundary, and a page boundary is usually much
  larger than a section alignment requirement, so no one noticed this
  bug before.

  Now, lld has --nmagic option which sets maxPageSize to 1 to
  effectively disable page alignment, which reveals the issue.

  Fixes https://bugs.llvm.org/show_bug.cgi?id=43212

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

Together, these should ensure gpboot.out gets a correctly aligned offset
for its .rodata section, and fix "layout constraint violation" errors
from objcopy.
2019-09-05 17:53:41 +00:00
..
include Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb, and openmp 2019-09-02 17:55:39 +00:00
lib Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb, and openmp 2019-09-02 17:55:39 +00:00
tools Pull in r369828 from upstream lld trunk (by Fāng-ruì Sòng): 2019-09-05 17:53:41 +00:00
utils/TableGen Merge llvm trunk r366426, resolve conflicts, and update FREEBSD-Xlist. 2019-08-21 18:13:02 +00:00
FREEBSD-Xlist Merge llvm trunk r366426, resolve conflicts, and update FREEBSD-Xlist. 2019-08-21 18:13:02 +00:00
LICENSE.TXT Merge llvm trunk r366426, resolve conflicts, and update FREEBSD-Xlist. 2019-08-21 18:13:02 +00:00