m4b/faerie

Artifact.import leads to invalid ELF

djg opened this issue · 0 comments

djg commented

Working with llvm2cretonne with on test.ll:

define void @foo(i32 %arg, i32 %arg1) {
bb:
  %tmp = icmp ult i32 %arg, 4
  %tmp2 = icmp eq i32 %arg1, 0
  %tmp3 = or i1 %tmp2, %tmp
  br i1 %tmp3, label %bb4, label %bb6

bb4:
  %tmp5 = call i32 @bar()
  ret void

bb6:
  ret void
}

declare i32 @bar()

and generating test.o using:

llvm2cretonne --isa intel --set is_64bit=1 -o test.o test.ll

Results in an invalid ELF.

It appears the Artifact.import helper for Artifact.declare results in the import being added to the list of imports twice.