[PATCH] D58625: [llvm-objcopy] - Check for invalidated relocations when removing a section.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 26 05:20:42 PST 2019


grimar added inline comments.


================
Comment at: test/tools/llvm-objcopy/ELF/strip-section-err.test:1
+## Check we cannot remove the section .data because it
+## is used by relocations contained in the object.
----------------
jhenderson wrote:
> I'd make this comment a little more general for the behaviour, by removing references to the section name and describing what is the interesting characteristic of it. Something like "Check we cannot remove a section containing symbols referenced by relocations contained in the object." or something along those lines.
Done.


================
Comment at: test/tools/llvm-objcopy/ELF/strip-section-err.test:5
+# RUN: yaml2obj %s > %t1
+# RUN: not llvm-objcopy -R .data %t1 2>&1 | FileCheck %s
+# CHECK: error: Section .data cannot be removed because of symbol 'foo' used by the relocation at offset 0x1 from section .rela.text.
----------------
jhenderson wrote:
> In addition to this test case, I've thought of another one: what happens if you remove both .data and .rela.text? That shouldn't produce an error, since the reference has also been removed.
Yes. Added such test.


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

https://reviews.llvm.org/D58625





More information about the llvm-commits mailing list