[PATCH] D106629: [lld/mac] Implement for section$start and section$ end symbols

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 22 19:14:45 PDT 2021


thakis created this revision.
thakis added a reviewer: lld-macho.
Herald added a subscriber: wenlei.
Herald added a reviewer: gkm.
Herald added a project: lld-macho.
thakis requested review of this revision.

With this, libclang_rt.profile_osx.a can be linked, that is coverage
and PGO-instrumented builds should now work with lld.

section$start and section$end symbols can create non-existing sections.
They're also undefined symbols that are only magic if there isn't a
regular symbol with their name, which means the need to be handled
in treatUndefined() instead of just looping over all existing
sections and adding start and end symbols like the ELF port does.

To represent the actual symbols, this uses absolute symbols that
get their value updated once an output section is layed out.

segment$start and segment$end are still missing for now, but they produce a
nicer error message after this patch.


https://reviews.llvm.org/D106629

Files:
  lld/MachO/OutputSection.cpp
  lld/MachO/OutputSection.h
  lld/MachO/SymbolTable.cpp
  lld/MachO/Writer.cpp
  lld/test/MachO/start-end.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106629.361066.patch
Type: text/x-patch
Size: 16373 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210723/d25362bb/attachment-0001.bin>


More information about the llvm-commits mailing list