Skip to content

Commit 2115a2d

Browse files
jsjisys-ce-bb
authored andcommitted
[ClangOffloadWrapper] Disable note section verification for now
This is exposed by | * fb5a38b 2024-07-11 [llvm-objcopy] Add verification of added .note section format [email protected] Somehow the ELFNotes added by ClangOffloadWrapper.cpp does NOT pass the verification. Looks like we used the "--add-section" wrongly – we call llvm-objcopy ONCE to add ALL the sections. While technically we should call llvm-objcopy for each section according to the doc? "--add-section <section=file> Add a section named <section> with the contents of <file> to the output. For ELF objects the section will be of type SHT_NOTE, if the name starts with “.note”. Otherwise, it will have type SHT_PROGBITS. **Can be specified multiple times to add multiple sections."** This is however common to upstream, so workaround it first by disabling the verification while we follow up to fix the problem.
1 parent ccdd84a commit 2115a2d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clang/tools/clang-offload-wrapper/ClangOffloadWrapper.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,6 +1494,7 @@ class BinaryWrapper {
14941494
Args.push_back(ObjcopyPath);
14951495
std::string Option("--add-section=.note.openmp=" + NotesTmpFileName);
14961496
Args.push_back(Option);
1497+
Args.push_back("--no-verify-note-sections");
14971498
Args.push_back(OriginalFileName);
14981499
Args.push_back(ELFTmpFileName);
14991500
bool ExecutionFailed = false;

0 commit comments

Comments
 (0)