[AIX][XCOFF][NFC] Change the SectionLen field name of CSect Auxiliary entry to Sectio...
authorJason Liu <jasonliu.development@gmail.com>
Wed, 9 Oct 2019 16:19:39 +0000 (16:19 +0000)
committerJason Liu <jasonliu.development@gmail.com>
Wed, 9 Oct 2019 16:19:39 +0000 (16:19 +0000)
Summary:
According the the XCOFF document,
If
Then
XTY_SD
x_scnlen contains the csect length.
XTY_LD
x_scnlen contains the symbol table index of the containing csect.
XTY_CM
x_scnlen contains the csect length.
XTY_ER
x_scnlen contains 0.

Change the SectionLen member name to SectionOrLength is more reasonable.

Authored By: DiggerLin

Reviewed By: hubert.reinterpretcast

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

llvm-svn: 374179

llvm/D68650.diff [new file with mode: 0644]
llvm/include/llvm/Object/XCOFFObjectFile.h
llvm/tools/llvm-readobj/XCOFFDumper.cpp

diff --git a/llvm/D68650.diff b/llvm/D68650.diff
new file mode 100644 (file)
index 0000000..063f1b8
--- /dev/null
@@ -0,0 +1,34 @@
+Index: llvm/include/llvm/Object/XCOFFObjectFile.h
+===================================================================
+--- llvm/include/llvm/Object/XCOFFObjectFile.h
++++ llvm/include/llvm/Object/XCOFFObjectFile.h
+@@ -113,7 +113,12 @@
+ };
+ struct XCOFFCsectAuxEnt32 {
+-  support::ubig32_t SectionLen;
++  support::ubig32_t
++      SectionOrLength; // If the symbol type is XTY_SD or XTY_CM, the csect
++                       // length.
++                       // If the symbol type is XTY_LD, the symbol table
++                       // index of the containing csect. 
++                       // If the symbol type is XTY_ER, 0.
+   support::ubig32_t ParameterHashIndex;
+   support::ubig16_t TypeChkSectNum;
+   uint8_t SymbolAlignmentAndType;
+Index: llvm/tools/llvm-readobj/XCOFFDumper.cpp
+===================================================================
+--- llvm/tools/llvm-readobj/XCOFFDumper.cpp
++++ llvm/tools/llvm-readobj/XCOFFDumper.cpp
+@@ -213,9 +213,9 @@
+   W.printNumber("Index",
+                 Obj.getSymbolIndex(reinterpret_cast<uintptr_t>(AuxEntPtr)));
+   if ((AuxEntPtr->SymbolAlignmentAndType & SymbolTypeMask) == XCOFF::XTY_LD)
+-    W.printNumber("ContainingCsectSymbolIndex", AuxEntPtr->SectionLen);
++    W.printNumber("ContainingCsectSymbolIndex", AuxEntPtr->SectionOrLength);
+   else
+-    W.printNumber("SectionLen", AuxEntPtr->SectionLen);
++    W.printNumber("SectionLen", AuxEntPtr->SectionOrLength);
+   W.printHex("ParameterHashIndex", AuxEntPtr->ParameterHashIndex);
+   W.printHex("TypeChkSectNum", AuxEntPtr->TypeChkSectNum);
+   // Print out symbol alignment and type.
index 9942e0d..eb4b45f 100644 (file)
@@ -113,7 +113,12 @@ struct XCOFFStringTable {
 };
 
 struct XCOFFCsectAuxEnt32 {
-  support::ubig32_t SectionLen;
+  support::ubig32_t
+      SectionOrLength; // If the symbol type is XTY_SD or XTY_CM, the csect
+                       // length.
+                       // If the symbol type is XTY_LD, the symbol table
+                       // index of the containing csect.
+                       // If the symbol type is XTY_ER, 0.
   support::ubig32_t ParameterHashIndex;
   support::ubig16_t TypeChkSectNum;
   uint8_t SymbolAlignmentAndType;
index 4fabead..c48d7ed 100644 (file)
@@ -161,9 +161,9 @@ void XCOFFDumper::printCsectAuxEnt32(const XCOFFCsectAuxEnt32 *AuxEntPtr) {
   W.printNumber("Index",
                 Obj.getSymbolIndex(reinterpret_cast<uintptr_t>(AuxEntPtr)));
   if ((AuxEntPtr->SymbolAlignmentAndType & SymbolTypeMask) == XCOFF::XTY_LD)
-    W.printNumber("ContainingCsectSymbolIndex", AuxEntPtr->SectionLen);
+    W.printNumber("ContainingCsectSymbolIndex", AuxEntPtr->SectionOrLength);
   else
-    W.printNumber("SectionLen", AuxEntPtr->SectionLen);
+    W.printNumber("SectionLen", AuxEntPtr->SectionOrLength);
   W.printHex("ParameterHashIndex", AuxEntPtr->ParameterHashIndex);
   W.printHex("TypeChkSectNum", AuxEntPtr->TypeChkSectNum);
   // Print out symbol alignment and type.