[all-commits] [llvm/llvm-project] 9854ed: [lld-macho] Implement basic export trie

Jez Ng via All-commits all-commits at lists.llvm.org
Wed Apr 29 15:52:42 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 9854edd817c9d48966a40de061a385b37f9a352d
      https://github.com/llvm/llvm-project/commit/9854edd817c9d48966a40de061a385b37f9a352d
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-04-29 (Wed, 29 Apr 2020)

  Changed paths:
    M lld/MachO/CMakeLists.txt
    A lld/MachO/ExportTrie.cpp
    A lld/MachO/ExportTrie.h
    M lld/MachO/SyntheticSections.cpp
    M lld/MachO/SyntheticSections.h
    M lld/test/MachO/Inputs/libhello.s
    M lld/test/MachO/dylink.s
    A lld/test/MachO/export-trie.s
    A lld/test/MachO/no-exports-dylib.s
    M lld/test/MachO/symtab.s

  Log Message:
  -----------
  [lld-macho] Implement basic export trie

Build the trie by performing a three-way radix quicksort: We start by
sorting the strings by their first characters, then sort the strings
with the same first characters by their second characters, and so on
recursively. Each time the prefixes diverge, we add a node to the trie.
Thanks to @ruiu for the idea.

I used llvm-mc's radix quicksort implementation as a starting point. The
trie offset fixpoint code was taken from
MachONormalizedFileBinaryWriter.cpp.

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


  Commit: 89285a1a97c0d9b63617f812f96604d1b0ae7033
      https://github.com/llvm/llvm-project/commit/89285a1a97c0d9b63617f812f96604d1b0ae7033
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-04-29 (Wed, 29 Apr 2020)

  Changed paths:
    M lld/MachO/Driver.cpp
    M lld/test/MachO/alignment-too-large.yaml
    M lld/test/MachO/arch.s
    M lld/test/MachO/duplicate-symbol.s
    M lld/test/MachO/entry-symbol.s
    M lld/test/MachO/invalid-executable.s
    M lld/test/MachO/missing-dylib.s
    M lld/test/MachO/no-id-dylink.s
    M lld/test/MachO/no-such-file.s
    M lld/test/MachO/silent-ignore.test

  Log Message:
  -----------
  [lld-macho] Disable colors in errors when not printing to a pty

This makes for better tests (and is just the right thing to do)

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


  Commit: 918948db4dc8718cb7aae8765653c27cba3cfe86
      https://github.com/llvm/llvm-project/commit/918948db4dc8718cb7aae8765653c27cba3cfe86
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-04-29 (Wed, 29 Apr 2020)

  Changed paths:
    M lld/MachO/InputFiles.cpp
    M lld/test/CMakeLists.txt
    A lld/test/MachO/fat-arch.s
    A lld/test/MachO/invalid-fat-narch.s
    A lld/test/MachO/invalid-fat-offset.s

  Log Message:
  -----------
  [lld-macho] Support reading of universal binaries

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


  Commit: df92377823d153ee3049060560771a2199712a9c
      https://github.com/llvm/llvm-project/commit/df92377823d153ee3049060560771a2199712a9c
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-04-29 (Wed, 29 Apr 2020)

  Changed paths:
    M lld/MachO/ExportTrie.cpp
    M lld/MachO/InputSection.cpp
    M lld/MachO/Symbols.h
    M lld/MachO/Writer.cpp

  Log Message:
  -----------
  [lld-macho] Have Symbol::getVA() return a non-relative virtual address

Currently, getVA() returns a virtual address with the assumption that
the ImageBase is zero. As I understand, this is what lld-ELF is doing.
However, under our current design, it seems like an awkward setup --
I'm finding that I have to add and subtract ImageBase in several places
to make things work out.

As such, I think it's simpler to have getVA() return a non-relative VA,
but I'm not sure if I'm missing something. Would love to hear more from
folks familiar with lld-ELF.

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


  Commit: e82c5e17b58fdbb096fa408092d7629b2b6e26f9
      https://github.com/llvm/llvm-project/commit/e82c5e17b58fdbb096fa408092d7629b2b6e26f9
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-04-29 (Wed, 29 Apr 2020)

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

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

Relatively straightforward diff, to set the stage for calling functions
in dylibs.

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


Compare: https://github.com/llvm/llvm-project/compare/3ab319b29559...e82c5e17b58f


More information about the All-commits mailing list