[lld] r262794 - [ELF] - Changed return type of Target::relaxTls()

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 5 22:09:51 PST 2016


Author: grimar
Date: Sun Mar  6 00:09:50 2016
New Revision: 262794

URL: http://llvm.org/viewvc/llvm-project?rev=262794&view=rev
Log:
[ELF] - Changed return type of Target::relaxTls()

Patch changes the return type of Target::relaxTls 
to size_t from unsigned. That is consistent with
its use from other code.

Change was reviewed http://reviews.llvm.org/D17882
and asked to commit separately from that patch above.

Modified:
    lld/trunk/ELF/Target.cpp
    lld/trunk/ELF/Target.h

Modified: lld/trunk/ELF/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=262794&r1=262793&r2=262794&view=diff
==============================================================================
--- lld/trunk/ELF/Target.cpp (original)
+++ lld/trunk/ELF/Target.cpp Sun Mar  6 00:09:50 2016
@@ -99,8 +99,8 @@ public:
   void relocateOne(uint8_t *Loc, uint8_t *BufEnd, uint32_t Type, uint64_t P,
                    uint64_t SA, uint64_t ZA = 0,
                    uint8_t *PairedLoc = nullptr) const override;
-  unsigned relaxTls(uint8_t *Loc, uint8_t *BufEnd, uint32_t Type, uint64_t P,
-                    uint64_t SA, const SymbolBody *S) const override;
+  size_t relaxTls(uint8_t *Loc, uint8_t *BufEnd, uint32_t Type, uint64_t P,
+                  uint64_t SA, const SymbolBody *S) const override;
   bool isGotRelative(uint32_t Type) const override;
   bool refersToGotEntry(uint32_t Type) const override;
 
@@ -138,8 +138,8 @@ public:
                    uint8_t *PairedLoc = nullptr) const override;
   bool isRelRelative(uint32_t Type) const override;
   bool isSizeRel(uint32_t Type) const override;
-  unsigned relaxTls(uint8_t *Loc, uint8_t *BufEnd, uint32_t Type, uint64_t P,
-                    uint64_t SA, const SymbolBody *S) const override;
+  size_t relaxTls(uint8_t *Loc, uint8_t *BufEnd, uint32_t Type, uint64_t P,
+                  uint64_t SA, const SymbolBody *S) const override;
 
 private:
   void relocateTlsLdToLe(uint8_t *Loc, uint8_t *BufEnd, uint64_t P,
@@ -193,8 +193,8 @@ public:
   void relocateOne(uint8_t *Loc, uint8_t *BufEnd, uint32_t Type, uint64_t P,
                    uint64_t SA, uint64_t ZA = 0,
                    uint8_t *PairedLoc = nullptr) const override;
-  unsigned relaxTls(uint8_t *Loc, uint8_t *BufEnd, uint32_t Type, uint64_t P,
-                    uint64_t SA, const SymbolBody *S) const override;
+  size_t relaxTls(uint8_t *Loc, uint8_t *BufEnd, uint32_t Type, uint64_t P,
+                  uint64_t SA, const SymbolBody *S) const override;
 
 private:
   void relocateTlsGdToLe(uint32_t Type, uint8_t *Loc, uint8_t *BufEnd,
@@ -368,9 +368,9 @@ bool TargetInfo::isTlsGlobalDynamicRel(u
   return false;
 }
 
-unsigned TargetInfo::relaxTls(uint8_t *Loc, uint8_t *BufEnd, uint32_t Type,
-                              uint64_t P, uint64_t SA,
-                              const SymbolBody *S) const {
+size_t TargetInfo::relaxTls(uint8_t *Loc, uint8_t *BufEnd, uint32_t Type,
+                            uint64_t P, uint64_t SA,
+                            const SymbolBody *S) const {
   return 0;
 }
 
@@ -559,9 +559,9 @@ bool X86TargetInfo::needsDynRelative(uin
   return Config->Shared && Type == R_386_TLS_IE;
 }
 
-unsigned X86TargetInfo::relaxTls(uint8_t *Loc, uint8_t *BufEnd, uint32_t Type,
-                                 uint64_t P, uint64_t SA,
-                                 const SymbolBody *S) const {
+size_t X86TargetInfo::relaxTls(uint8_t *Loc, uint8_t *BufEnd, uint32_t Type,
+                               uint64_t P, uint64_t SA,
+                               const SymbolBody *S) const {
   switch (Type) {
   case R_386_TLS_GD:
     if (canBePreempted(S))
@@ -907,9 +907,9 @@ void X86_64TargetInfo::relocateTlsIeToLe
 // relocation target, relocations immediately follow the TLS relocation (which
 // would be applied to rewritten instructions) may have to be skipped.
 // This function returns a number of relocations that need to be skipped.
-unsigned X86_64TargetInfo::relaxTls(uint8_t *Loc, uint8_t *BufEnd,
-                                    uint32_t Type, uint64_t P, uint64_t SA,
-                                    const SymbolBody *S) const {
+size_t X86_64TargetInfo::relaxTls(uint8_t *Loc, uint8_t *BufEnd, uint32_t Type,
+                                  uint64_t P, uint64_t SA,
+                                  const SymbolBody *S) const {
   switch (Type) {
   case R_X86_64_DTPOFF32:
     relocateOne(Loc, BufEnd, R_X86_64_TPOFF32, P, SA);
@@ -1486,9 +1486,9 @@ void AArch64TargetInfo::relocateOne(uint
   }
 }
 
-unsigned AArch64TargetInfo::relaxTls(uint8_t *Loc, uint8_t *BufEnd,
-                                     uint32_t Type, uint64_t P, uint64_t SA,
-                                     const SymbolBody *S) const {
+size_t AArch64TargetInfo::relaxTls(uint8_t *Loc, uint8_t *BufEnd, uint32_t Type,
+                                   uint64_t P, uint64_t SA,
+                                   const SymbolBody *S) const {
   switch (Type) {
   case R_AARCH64_TLSDESC_ADR_PAGE21:
   case R_AARCH64_TLSDESC_LD64_LO12_NC:

Modified: lld/trunk/ELF/Target.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.h?rev=262794&r1=262793&r2=262794&view=diff
==============================================================================
--- lld/trunk/ELF/Target.h (original)
+++ lld/trunk/ELF/Target.h Sun Mar  6 00:09:50 2016
@@ -70,8 +70,8 @@ public:
   bool canRelaxTls(uint32_t Type, const SymbolBody *S) const;
   template <class ELFT>
   bool needsCopyRel(uint32_t Type, const SymbolBody &S) const;
-  virtual unsigned relaxTls(uint8_t *Loc, uint8_t *BufEnd, uint32_t Type,
-                            uint64_t P, uint64_t SA, const SymbolBody *S) const;
+  virtual size_t relaxTls(uint8_t *Loc, uint8_t *BufEnd, uint32_t Type,
+                          uint64_t P, uint64_t SA, const SymbolBody *S) const;
   virtual ~TargetInfo();
 
   unsigned PageSize = 4096;




More information about the llvm-commits mailing list