[PATCH] D73999: [MC][ELF] Error for sh_type, sh_flags or sh_entsize change

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 19 22:34:34 PST 2020


MaskRay marked an inline comment as done.
MaskRay added inline comments.


================
Comment at: llvm/test/MC/ELF/section-flags-changed.s:6
+
+# CHECK: {{.*}}.s:[[# @LINE+1]]:1: error: changed section flags for .foo, expected: 0x6
+.section .foo,"awx", at progbits
----------------
0x6 is not ideal in terms of UI friendliness, but I think it is a fine compromise.
Additional complexity is that some sh_flags bits are OS/Processor specific, so the mapping isn't 1:1.

This diagnostic targets assembly users. They know how to figure out what they should write for the .section directive.


================
Comment at: llvm/test/MC/ELF/section-type-changed.s:9
+# CHECK: {{.*}}.s:[[# @LINE+1]]:1: warning: ignoring changed section type for .foo
+.section .foo,"a", at note
+
----------------
jhenderson wrote:
> Any particular reason for this extra case here?
A very weak reason for checking a different type. I think the reason is obvious from the test case name and the warning, so I will delete it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73999





More information about the llvm-commits mailing list