[llvm] [llvm-objcopy][ELF] Add an option to remove notes (PR #118739)

Igor Kudrin via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 16 18:22:46 PST 2025


================
@@ -609,6 +609,97 @@ static void addSymbol(Object &Obj, const NewSymbolInfo &SymInfo,
       Sec ? (uint16_t)SYMBOL_SIMPLE_INDEX : (uint16_t)SHN_ABS, 0);
 }
 
+namespace {
+struct RemoveNoteDetail {
+  struct DeletedRange {
+    uint64_t OldFrom;
+    uint64_t OldTo;
+    uint64_t NewPos;
+  };
+
+  template <class ELFT>
+  static std::vector<DeletedRange>
+  findNotesToRemove(ArrayRef<uint8_t> Data, size_t Align,
+                    ArrayRef<RemoveNoteInfo> NotesToRemove);
+  static std::vector<uint8_t> updateData(ArrayRef<uint8_t> OldData,
+                                         ArrayRef<DeletedRange> ToRemove);
+};
+
----------------
igorkudrin wrote:

I can't find any guidelines on this. I'll remove a blank line before the closing bracket.

https://github.com/llvm/llvm-project/pull/118739


More information about the llvm-commits mailing list