[PATCH] D117058: [ifs] Added missing DT_STRSZ to the .dynamic section

Haowei Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 13 21:06:08 PST 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa59bb21bf85e: [ifs] Added missing DT_STRSZ to the .dynamic section (authored by haowei).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117058

Files:
  llvm/lib/InterfaceStub/ELFObjHandler.cpp
  llvm/test/tools/llvm-ifs/write-stub.test


Index: llvm/test/tools/llvm-ifs/write-stub.test
===================================================================
--- llvm/test/tools/llvm-ifs/write-stub.test
+++ llvm/test/tools/llvm-ifs/write-stub.test
@@ -142,10 +142,11 @@
 # CHECK-NEXT:   EntrySize: 0
 # CHECK-NEXT: }
 
-# CHECK:      DynamicSection [ (4 entries)
+# CHECK:      DynamicSection [ (5 entries)
 # CHECK-NEXT:   Tag                Type   Name/Value
 # CHECK-NEXT:   0x[[DYNTABZ]]0000006 SYMTAB
 # CHECK-NEXT:   0x[[DYNTABZ]]0000005 STRTAB
+# CHECK-NEXT:   0x[[DYNTABZ]]000000A STRSZ
 # CHECK-NEXT:   0x[[DYNTABZ]]0000001 NEEDED Shared library: [libc.so.6]
 # CHECK-NEXT:   0x[[DYNTABZ]]0000000 NULL
 # CHECK-NEXT: ]
Index: llvm/lib/InterfaceStub/ELFObjHandler.cpp
===================================================================
--- llvm/lib/InterfaceStub/ELFObjHandler.cpp
+++ llvm/lib/InterfaceStub/ELFObjHandler.cpp
@@ -226,6 +226,7 @@
     // Poplulate dynamic table.
     size_t DynSymIndex = DynTab.Content.addAddr(DT_SYMTAB, 0);
     size_t DynStrIndex = DynTab.Content.addAddr(DT_STRTAB, 0);
+    DynTab.Content.addValue(DT_STRSZ, DynSym.Size);
     for (const std::string &Lib : Stub.NeededLibs)
       DynTab.Content.addValue(DT_NEEDED, DynStr.Content.getOffset(Lib));
     if (Stub.SoName)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117058.408326.patch
Type: text/x-patch
Size: 1274 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220214/33b43c97/attachment.bin>


More information about the llvm-commits mailing list