File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -60,17 +60,15 @@ Hexagon::Hexagon() {
60
60
}
61
61
62
62
uint32_t Hexagon::calcEFlags () const {
63
- assert (!ctx.objectFiles .empty ());
64
-
65
63
// The architecture revision must always be equal to or greater than
66
64
// greatest revision in the list of inputs.
67
- uint32_t ret = 0 ;
65
+ std::optional< uint32_t > ret;
68
66
for (InputFile *f : ctx.objectFiles ) {
69
67
uint32_t eflags = cast<ObjFile<ELF32LE>>(f)->getObj ().getHeader ().e_flags ;
70
- if (eflags > ret)
68
+ if (!ret || eflags > * ret)
71
69
ret = eflags;
72
70
}
73
- return ret;
71
+ return ret. value_or ( /* Default Arch Rev: */ 0x60 ) ;
74
72
}
75
73
76
74
static uint32_t applyMask (uint32_t mask, uint32_t data) {
Original file line number Diff line number Diff line change 5
5
# RUN: llvm-readelf -h %t3 | FileCheck %s
6
6
# Verify that the largest arch in the input list is selected.
7
7
# CHECK: Flags: 0x62
8
+
9
+ # RUN: llvm-ar rcsD %t4
10
+ # RUN: ld.lld -m hexagonelf %t4 -o %t5
11
+ # RUN: llvm-readelf -h %t5 | FileCheck --check-prefix=CHECK-EMPTYARCHIVE %s
12
+ # CHECK-EMPTYARCHIVE: Flags: 0x60
You can’t perform that action at this time.
0 commit comments