[PATCH] D98586: [lld-macho][nfc] Move list of section names into InputSection.h

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 13 14:42:09 PST 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG04eec6f8815f: [lld-macho][nfc] Move list of section names into InputSection.h (authored by int3).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98586/new/

https://reviews.llvm.org/D98586

Files:
  lld/MachO/InputSection.h
  lld/MachO/SyntheticSections.cpp
  lld/MachO/SyntheticSections.h


Index: lld/MachO/SyntheticSections.h
===================================================================
--- lld/MachO/SyntheticSections.h
+++ lld/MachO/SyntheticSections.h
@@ -28,36 +28,6 @@
 namespace lld {
 namespace macho {
 
-namespace section_names {
-
-constexpr const char pageZero[] = "__pagezero";
-constexpr const char common[] = "__common";
-constexpr const char header[] = "__mach_header";
-constexpr const char rebase[] = "__rebase";
-constexpr const char binding[] = "__binding";
-constexpr const char weakBinding[] = "__weak_binding";
-constexpr const char lazyBinding[] = "__lazy_binding";
-constexpr const char export_[] = "__export";
-constexpr const char functionStarts_[] = "__functionStarts";
-constexpr const char symbolTable[] = "__symbol_table";
-constexpr const char indirectSymbolTable[] = "__ind_sym_tab";
-constexpr const char stringTable[] = "__string_table";
-constexpr const char codeSignature[] = "__code_signature";
-constexpr const char got[] = "__got";
-constexpr const char threadPtrs[] = "__thread_ptrs";
-constexpr const char unwindInfo[] = "__unwind_info";
-// these are not synthetic, but in service of synthetic __unwind_info
-constexpr const char compactUnwind[] = "__compact_unwind";
-constexpr const char ehFrame[] = "__eh_frame";
-// these are not synthetic, but need to be sorted
-constexpr const char text[] = "__text";
-constexpr const char stubs[] = "__stubs";
-constexpr const char stubHelper[] = "__stub_helper";
-constexpr const char laSymbolPtr[] = "__la_symbol_ptr";
-constexpr const char data[] = "__data";
-
-} // namespace section_names
-
 class Defined;
 class DylibSymbol;
 class LoadCommand;
Index: lld/MachO/SyntheticSections.cpp
===================================================================
--- lld/MachO/SyntheticSections.cpp
+++ lld/MachO/SyntheticSections.cpp
@@ -597,8 +597,7 @@
 void ExportSection::writeTo(uint8_t *buf) const { trieBuilder.writeTo(buf); }
 
 FunctionStartsSection::FunctionStartsSection()
-    : LinkEditSection(segment_names::linkEdit, section_names::functionStarts_) {
-}
+    : LinkEditSection(segment_names::linkEdit, section_names::functionStarts) {}
 
 void FunctionStartsSection::finalizeContents() {
   raw_svector_ostream os{contents};
Index: lld/MachO/InputSection.h
===================================================================
--- lld/MachO/InputSection.h
+++ lld/MachO/InputSection.h
@@ -76,6 +76,34 @@
 
 extern std::vector<InputSection *> inputSections;
 
+namespace section_names {
+
+constexpr const char pageZero[] = "__pagezero";
+constexpr const char common[] = "__common";
+constexpr const char header[] = "__mach_header";
+constexpr const char rebase[] = "__rebase";
+constexpr const char binding[] = "__binding";
+constexpr const char weakBinding[] = "__weak_binding";
+constexpr const char lazyBinding[] = "__lazy_binding";
+constexpr const char export_[] = "__export";
+constexpr const char functionStarts[] = "__func_starts";
+constexpr const char symbolTable[] = "__symbol_table";
+constexpr const char indirectSymbolTable[] = "__ind_sym_tab";
+constexpr const char stringTable[] = "__string_table";
+constexpr const char codeSignature[] = "__code_signature";
+constexpr const char got[] = "__got";
+constexpr const char threadPtrs[] = "__thread_ptrs";
+constexpr const char unwindInfo[] = "__unwind_info";
+constexpr const char compactUnwind[] = "__compact_unwind";
+constexpr const char ehFrame[] = "__eh_frame";
+constexpr const char text[] = "__text";
+constexpr const char stubs[] = "__stubs";
+constexpr const char stubHelper[] = "__stub_helper";
+constexpr const char laSymbolPtr[] = "__la_symbol_ptr";
+constexpr const char data[] = "__data";
+
+} // namespace section_names
+
 } // namespace macho
 
 std::string toString(const macho::InputSection *);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98586.330477.patch
Type: text/x-patch
Size: 3786 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210313/09f709b7/attachment.bin>


More information about the llvm-commits mailing list