[all-commits] [llvm/llvm-project] 2f4cfa: [lld-macho] Avoid explicit -arch in tests by defau...

Jez Ng via All-commits all-commits at lists.llvm.org
Wed Jun 17 20:41:59 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 2f4cfa3c7adda3f77d1773c80940cb4118c75c1e
      https://github.com/llvm/llvm-project/commit/2f4cfa3c7adda3f77d1773c80940cb4118c75c1e
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-06-17 (Wed, 17 Jun 2020)

  Changed paths:
    M lld/MachO/Driver.cpp
    M lld/test/MachO/arch.s
    M lld/test/MachO/archive.s
    M lld/test/MachO/dylib.s
    M lld/test/MachO/dylink-lazy.s
    M lld/test/MachO/dylink.s
    M lld/test/MachO/entry-symbol.s
    M lld/test/MachO/export-trie.s
    M lld/test/MachO/fat-arch.s
    M lld/test/MachO/invalid/alignment-too-large.yaml
    M lld/test/MachO/invalid/archive-no-index.s
    M lld/test/MachO/invalid/bad-archive.s
    M lld/test/MachO/invalid/duplicate-symbol.s
    M lld/test/MachO/invalid/invalid-executable.s
    M lld/test/MachO/invalid/invalid-fat-narch.s
    M lld/test/MachO/invalid/invalid-fat-offset.s
    M lld/test/MachO/invalid/invalid-relocation-length.yaml
    M lld/test/MachO/invalid/invalid-relocation-pcrel.yaml
    M lld/test/MachO/invalid/missing-dylib.s
    M lld/test/MachO/invalid/no-id-dylink.yaml
    M lld/test/MachO/invalid/no-such-file.s
    M lld/test/MachO/invalid/order-file-bad-arch.test
    M lld/test/MachO/invalid/order-file-bad-objfile.test
    M lld/test/MachO/invalid/stub-link.s
    M lld/test/MachO/invalid/undefined-symbol.s
    M lld/test/MachO/link-search-order.s
    M lld/test/MachO/load-commands.s
    M lld/test/MachO/no-exports-dylib.s
    M lld/test/MachO/order-file.s
    M lld/test/MachO/platform-version.test
    M lld/test/MachO/relocations.s
    M lld/test/MachO/resolution.s
    M lld/test/MachO/search-paths.test
    M lld/test/MachO/section-headers.s
    M lld/test/MachO/section-merge.s
    M lld/test/MachO/segments.s
    M lld/test/MachO/silent-ignore.test
    M lld/test/MachO/static-link.s
    M lld/test/MachO/stub-link.s
    M lld/test/MachO/sub-library.s
    M lld/test/MachO/subsections-section-relocs.s
    M lld/test/MachO/subsections-symbol-relocs.s
    M lld/test/MachO/symbol-order.s
    M lld/test/MachO/symtab.s
    M lld/test/MachO/x86-64-reloc-signed.s
    M lld/test/MachO/x86-64-reloc-unsigned.s

  Log Message:
  -----------
  [lld-macho] Avoid explicit -arch in tests by defaulting to x86-64

Summary:
As mentioned in https://reviews.llvm.org/D81326#2093931, I'm not sure it
makes sense to use the default target triple to determine -arch.
Long-term we should probably detect it from the input object files, but
in the meantime it would be nice not to have to add it to all our tests
by using a convenient default.

Reviewers: #lld-macho

Subscribers: arphaman, llvm-commits

Tags: #llvm

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


  Commit: fcde378dcbdf2447e543d75d012bebae91a3d0c6
      https://github.com/llvm/llvm-project/commit/fcde378dcbdf2447e543d75d012bebae91a3d0c6
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-06-17 (Wed, 17 Jun 2020)

  Changed paths:
    M lld/MachO/InputFiles.cpp
    M lld/test/MachO/relocations.s

  Log Message:
  -----------
  [lld-macho] Support non-pcrel section relocs

Summary: Depends on D80854.

Reviewers: ruiu, pcc, MaskRay, smeenai, alexshap, gkm, Ktwu, christylee

Subscribers: llvm-commits

Tags: #llvm

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


  Commit: c3d98ea89fa4807f06121ec186c00fa18593bfd0
      https://github.com/llvm/llvm-project/commit/c3d98ea89fa4807f06121ec186c00fa18593bfd0
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-06-17 (Wed, 17 Jun 2020)

  Changed paths:
    M lld/MachO/Arch/X86_64.cpp
    M lld/test/MachO/dylink.s

  Log Message:
  -----------
  [lld-macho] Support X86_64_RELOC_GOT

Summary:
As far as I can tell, it's identical to _GOT_LOAD. llvm-mc has the following
comment explaining why _GOT exists:

```
// x86_64 distinguishes movq foo at GOTPCREL so that the linker can
// rewrite the movq to an leaq at link time if the symbol ends up in
// the same linkage unit.
```

Depends on D80855.

Reviewers: ruiu, pcc, MaskRay, smeenai, alexshap, gkm, Ktwu, christylee

Reviewed By: MaskRay, smeenai

Subscribers: llvm-commits

Tags: #llvm

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


  Commit: a12e7d406de2c31633414e5c73881869c930d194
      https://github.com/llvm/llvm-project/commit/a12e7d406de2c31633414e5c73881869c930d194
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-06-17 (Wed, 17 Jun 2020)

  Changed paths:
    M lld/MachO/Arch/X86_64.cpp
    M lld/MachO/InputSection.cpp
    M lld/MachO/Symbols.h
    M lld/MachO/SyntheticSections.cpp
    M lld/MachO/SyntheticSections.h
    M lld/MachO/Target.h
    M lld/MachO/Writer.cpp
    A lld/test/MachO/local-got.s

  Log Message:
  -----------
  [lld-macho] Handle GOT relocations of non-dylib symbols

Summary:
Turns out this case is actually really common -- it happens whenever there's
a reference to an `extern` variable that ends up statically linked.

Depends on D80856.

Reviewers: ruiu, pcc, MaskRay, smeenai, alexshap, gkm, Ktwu, christylee

Reviewed By: smeenai

Subscribers: llvm-commits

Tags: #llvm

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


  Commit: 74871cdad729aa5a5f39804214e5872f8e418d8e
      https://github.com/llvm/llvm-project/commit/74871cdad729aa5a5f39804214e5872f8e418d8e
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-06-17 (Wed, 17 Jun 2020)

  Changed paths:
    M lld/MachO/InputFiles.cpp
    M lld/MachO/InputSection.cpp
    M lld/MachO/InputSection.h
    M lld/MachO/SyntheticSections.cpp
    M lld/MachO/Writer.cpp
    A lld/test/MachO/bss.s

  Log Message:
  -----------
  [lld-macho] Ensure __bss sections we output have file offset of zero

Summary:
llvm-mc emits `__bss` sections with an offset of zero, but we weren't expecting
that in our input, so we were copying non-zero data from the start of the file and
putting it in `__bss`, with obviously undesirable runtime results. (It appears that
the kernel will copy those nonzero bytes as long as the offset is nonzero, regardless
of whether S_ZERO_FILL is set.)

I debated on whether to make a special ZeroFillSection -- separate from a
regular InputSection -- but it seemed like too much work for now. But I'm happy
to refactor if anyone feels strongly about having it as a separate class.

Depends on D80857.

Reviewers: ruiu, pcc, MaskRay, smeenai, alexshap, gkm, Ktwu, christylee

Reviewed By: smeenai

Subscribers: llvm-commits

Tags: #llvm

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


  Commit: 525c7d8cda72c00c85de4989bcddefd4fb9a14a1
      https://github.com/llvm/llvm-project/commit/525c7d8cda72c00c85de4989bcddefd4fb9a14a1
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-06-17 (Wed, 17 Jun 2020)

  Changed paths:
    M lld/MachO/MergedOutputSection.cpp
    M lld/test/MachO/section-merge.s

  Log Message:
  -----------
  [lld-macho] Handle alignment correctly when merging InputSections

Summary:
Previously, we weren't updating isecAddr when aligning InputSections,
resulting in truncated sections under the right conditions.

Reviewers: #lld-macho, compnerd

Reviewed By: #lld-macho, compnerd

Subscribers: smeenai, compnerd, llvm-commits

Tags: #llvm

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


  Commit: d50f44a2f771b0872f6555cc3023cc5e9cfacabd
      https://github.com/llvm/llvm-project/commit/d50f44a2f771b0872f6555cc3023cc5e9cfacabd
  Author: Greg McGary <gkm at fb.com>
  Date:   2020-06-17 (Wed, 17 Jun 2020)

  Changed paths:
    M lld/MachO/Config.h
    M lld/MachO/Driver.cpp
    M lld/test/MachO/search-paths.test

  Log Message:
  -----------
  [lld-macho] Handle framework search path, alongside library search path

Summary:
Add front-end support for `lld::macho::Configuration::frameworkSearchPath`.

Depends on D80582.

Reviewers: ruiu, pcc, MaskRay, smeenai, int3, Ktwu, alexshap, christylee

Reviewed By: int3

Subscribers: ormris, llvm-commits

Tags: #llvm

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


Compare: https://github.com/llvm/llvm-project/compare/77b79d79c05f...d50f44a2f771


More information about the All-commits mailing list