[lld] r298669 - Update comments.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 23 17:15:58 PDT 2017


Author: ruiu
Date: Thu Mar 23 19:15:57 2017
New Revision: 298669

URL: http://llvm.org/viewvc/llvm-project?rev=298669&view=rev
Log:
Update comments.

Modified:
    lld/trunk/ELF/Driver.cpp
    lld/trunk/ELF/LinkerScript.cpp
    lld/trunk/ELF/SyntheticSections.h
    lld/trunk/ELF/Threads.h
    lld/trunk/ELF/Writer.cpp

Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=298669&r1=298668&r2=298669&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Thu Mar 23 19:15:57 2017
@@ -18,8 +18,8 @@
 // I don't think implicit default values are useful because they are
 // usually explicitly specified by the compiler driver. They can even
 // be harmful when you are doing cross-linking. Therefore, in LLD, we
-// simply trust the compiler driver to pass all required options to us
-// and don't try to make effort on our side.
+// simply trust the compiler driver to pass all required options and
+// don't try to make effort on our side.
 //
 //===----------------------------------------------------------------------===//
 

Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=298669&r1=298668&r2=298669&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Thu Mar 23 19:15:57 2017
@@ -777,8 +777,8 @@ static bool shouldSkip(const BaseCommand
 //
 // When the control reaches this function, Opt.Commands contains
 // output section commands for non-orphan sections only. This function
-// adds new elements for orphan sections to Opt.Commands so that all
-// sections are explicitly handled by Opt.Commands.
+// adds new elements for orphan sections so that all sections are
+// explicitly handled by Opt.Commands.
 //
 // Writer<ELFT>::sortSections has already sorted output sections.
 // What we need to do is to scan OutputSections vector and
@@ -788,7 +788,7 @@ static bool shouldSkip(const BaseCommand
 //
 // There is some ambiguity as to where exactly a new entry should be
 // inserted, because Opt.Commands contains not only output section
-// commands but other types of commands such as symbol assignment
+// commands but also other types of commands such as symbol assignment
 // expressions. There's no correct answer here due to the lack of the
 // formal specification of the linker script. We use heuristics to
 // determine whether a new output command should be added before or

Modified: lld/trunk/ELF/SyntheticSections.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.h?rev=298669&r1=298668&r2=298669&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.h (original)
+++ lld/trunk/ELF/SyntheticSections.h Thu Mar 23 19:15:57 2017
@@ -154,9 +154,9 @@ private:
 };
 
 // BssSection is used to reserve space for copy relocations and common symbols.
-// We create three instances of this class for .bss, .bss.rel.ro and "COMMON".
-// .bss is used for writable symbols, .bss.rel.ro is used for read-only symbols
-// and latter used for common symbols.
+// We create three instances of this class for .bss, .bss.rel.ro and "COMMON",
+// that are used for writable symbols, read-only symbols and common symbols,
+// respectively.
 class BssSection final : public SyntheticSection {
 public:
   BssSection(StringRef Name);

Modified: lld/trunk/ELF/Threads.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Threads.h?rev=298669&r1=298668&r2=298669&view=diff
==============================================================================
--- lld/trunk/ELF/Threads.h (original)
+++ lld/trunk/ELF/Threads.h Thu Mar 23 19:15:57 2017
@@ -15,7 +15,7 @@
 //
 // That said, we don't want to do "too clever" things using threads.
 // Complex multi-threaded algorithms are sometimes extremely hard to
-// justify the correctness and can easily mess up the entire design.
+// reason about and can easily mess up the entire design.
 //
 // Fortunately, when a linker links large programs (when the link time is
 // most critical), it spends most of the time to work on massive number of
@@ -34,7 +34,7 @@
 // instead of std::for_each (or a plain for loop). Because tasks are
 // completely independent from each other, we can run them in parallel
 // without any coordination between them. That's very easy to understand
-// and justify.
+// and reason about.
 //
 // For the cases such as the latter, we can use parallel algorithms to
 // deal with massive data. We have to write code for a tailored algorithm

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=298669&r1=298668&r2=298669&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Thu Mar 23 19:15:57 2017
@@ -1337,9 +1337,8 @@ template <class ELFT> std::vector<PhdrEn
     AddHdr(PT_GNU_EH_FRAME, In<ELFT>::EhFrameHdr->OutSec->getPhdrFlags())
         ->add(In<ELFT>::EhFrameHdr->OutSec);
 
-  // PT_OPENBSD_RANDOMIZE specifies the location and size of a part of the
-  // memory image of the program that must be filled with random data before any
-  // code in the object is executed.
+  // PT_OPENBSD_RANDOMIZE is an OpenBSD-specific feature. That makes
+  // the dynamic linker fill the segment with random data.
   if (OutputSection *Sec = findSection(".openbsd.randomdata"))
     AddHdr(PT_OPENBSD_RANDOMIZE, Sec->getPhdrFlags())->add(Sec);
 




More information about the llvm-commits mailing list