[all-commits] [llvm/llvm-project] e72403: [LLD] [MinGW] Enable dynamicbase by default

Martin Storsjö via All-commits all-commits at lists.llvm.org
Thu Aug 27 05:11:18 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e72403f96de7f1c681acd5968f72aa986412dfce
      https://github.com/llvm/llvm-project/commit/e72403f96de7f1c681acd5968f72aa986412dfce
  Author: Martin Storsjö <martin at martin.st>
  Date:   2020-08-27 (Thu, 27 Aug 2020)

  Changed paths:
    M lld/MinGW/Driver.cpp
    M lld/MinGW/Options.td
    M lld/test/MinGW/driver.test

  Log Message:
  -----------
  [LLD] [MinGW] Enable dynamicbase by default

This matches lld-link's own default.

Add a new command line option --no-dynamicbase for disabling it.
(Unfortunately, GNU ld doesn't yet have a matching --no-dynamicbase
option, as that's the default there.)

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


  Commit: df8f3bf6266569545b0b80eccbd990fecb94b3ee
      https://github.com/llvm/llvm-project/commit/df8f3bf6266569545b0b80eccbd990fecb94b3ee
  Author: Martin Storsjö <martin at martin.st>
  Date:   2020-08-27 (Thu, 27 Aug 2020)

  Changed paths:
    M lld/COFF/InputFiles.cpp
    M lld/COFF/InputFiles.h
    A lld/test/COFF/Inputs/comdat-binutils.yaml
    A lld/test/COFF/Inputs/comdat-llvm.yaml
    A lld/test/COFF/comdat-gcc-compatibility-size.test

  Log Message:
  -----------
  [LLD] [COFF] Check the aux section definition size for IMAGE_COMDAT_SELECT_SAME_SIZE

Binutils generated sections seem to be padded to a multiple of 16 bytes,
but the aux section definition contains the original, unpadded section
length.

The size check used for IMAGE_COMDAT_SELECT_SAME_SIZE previously
only checked the size of the section itself. When checking the
currently processed object file against the previously chosen
comdat section, we easily have access to the aux section definition
of the currently processed section, but we have to iterate over the
symbols of the previously selected object file to find the section
definition of the previously picked section. (We don't want to
inflate SectionChunk to carry more data, for something that is only
needed in corner cases.) Only do this when the mingw flag is set.

This fixes statically linking clang-built C++ object files against
libstdc++ built with GCC, if the object files contain e.g. typeinfo.

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


Compare: https://github.com/llvm/llvm-project/compare/c17718e0ff26...df8f3bf62665


More information about the All-commits mailing list