if (SecRef.sh_type == ELF::SHT_SYMTAB)
// TODO: Dynamic?
SymTab = SecRef;
+ } else {
+ auto &Section = G->createSection(*Name, Prot);
+ G->createZeroFillBlock(Section, Size, Address, Alignment, 0);
}
}
return Name.takeError();
auto Section = G->findSectionByName(*Name);
if (!Section)
- return make_error<llvm::StringError>("Could not find a section",
+ return make_error<llvm::StringError>("Could not find a section " +
+ *Name,
llvm::inconvertibleErrorCode());
// we only have one for now
auto blocks = Section->blocks();
auto JitSection = G->findSectionByName(*sectName);
if (!JitSection)
return make_error<llvm::StringError>(
- "Could not find a section", llvm::inconvertibleErrorCode());
+ "Could not find the JitSection " + *sectName,
+ llvm::inconvertibleErrorCode());
auto bs = JitSection->blocks();
if (bs.empty())
return make_error<llvm::StringError>(
.long 42
.size named_data, 4
+# Test BSS / zero-fill section handling.
+# llvm-jitlink: *{4}bss_variable = 0
+
+ .type bss_variable,@object
+ .bss
+ .globl bss_variable
+ .p2align 2
+bss_variable:
+ .long 0
+ .size bss_variable, 4
+
.ident "clang version 10.0.0-4ubuntu1 "
.section ".note.GNU-stack","",@progbits
- .addrsig
\ No newline at end of file
+ .addrsig