[PATCH] D90897: [llvm-objcopy] --only-keep-debug: place zero-size segment according to its parent segment

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 6 02:18:08 PST 2020


jhenderson added a comment.

Won't this fail if the PT_LOAD the PT_TLS should be in has a zero size too? In such a case, the PT_TLS segment won't be nested inside anything (see `segmentOverlapsSegment`).



================
Comment at: llvm/test/tools/llvm-objcopy/ELF/only-keep-debug.test:238
+# CHECK4-NEXT: [ 3] .tdata      NOBITS   0000000000001240 000240 000000 00 WAT  0   0 64
+# CHECK4-NEXT: [ 4] .got        NOBITS   0000000000001240 000240 000008 00  WA  0   0 0
+
----------------



================
Comment at: llvm/test/tools/llvm-objcopy/ELF/only-keep-debug.test:252
+Sections:
+  - Name:         .note
+    Type:         SHT_NOTE
----------------
It's not clear from the test comments why we need the .got, .note and .text sections in this output. Either remove them or add comments explaining their purpose.


================
Comment at: llvm/test/tools/llvm-objcopy/ELF/only-keep-debug.test:277
+    Align:    0x1000
+    Sections:
+      - Section: .note
----------------
Note: @grimar is working on D90458 which changes how sections within segments are represented.


================
Comment at: llvm/tools/llvm-objcopy/ELF/Object.cpp:2314
+    // An empty segment has no containing section (see sectionWithinSegment).
+    // If it has a parent segment, copy the parent segment's size field.  This
+    // works for empty PT_TLS.
----------------
Do you mean offset here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D90897



More information about the llvm-commits mailing list