You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[llvm-readobj] - Refine the error reporting in LLVMStyle<ELFT>::printELFLinkerOptions.
It is possible to:
1) Avoid using the `unwrapOrError` calls and hence allow to continue dumping even when
something is not OK with one of SHT_LLVM_LINKER_OPTIONS sections.
2) replace `reportWarning` with `reportUniqueWarning` calls. In this method it is no-op,
because it is not possible to have a duplicated warnings anyways, but since we probably
want to switch to `reportUniqueWarning` globally, this is a good thing to do.
This patch addresses both these points.
Differential revision: https://reviews.llvm.org/D83131
# CHECK-NEXT: warning: '[[FILE]]': SHT_LLVM_LINKER_OPTIONS section at index 2 is broken: an incomplete key-value pair was found. The last possible key was: "c"
11
11
# CHECK-NEXT: warning: '[[FILE]]': SHT_LLVM_LINKER_OPTIONS section at index 4 is broken: the content is not null-terminated
12
+
# CHECK-NEXT: warning: '[[FILE]]': unable to read the content of the SHT_LLVM_LINKER_OPTIONS section: section [index 5] has a sh_offset (0xffffffff) + sh_size (0x8) that is greater than the file size (0x370)
12
13
# CHECK-NEXT: option 3: value 3
13
14
# CHECK-NEXT: ]
14
15
@@ -44,7 +45,15 @@ Sections:
44
45
- Name: .linker-options.nonul
45
46
Type: SHT_LLVM_LINKER_OPTIONS
46
47
Content: "61"
47
-
## Case 5: another correct case to show we do not stop dumping after reporting a warning.
48
+
## Case 5: check we report a warning when it is not possible to read
49
+
## the content of the SHT_LLVM_LINKER_OPTIONS section.
50
+
- Name: .linker-options.broken.content
51
+
Type: SHT_LLVM_LINKER_OPTIONS
52
+
ShOffset: 0xffffffff
53
+
Options:
54
+
- Name: foo
55
+
Value: bar
56
+
## Case 6: another correct case to show we do not stop dumping after reporting a warning.
0 commit comments