-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update wasm handling of embedded bitcode #48
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// REQUIRES: webassembly-registered-target | ||
|
||
// RUN: %clang -c -target wasm32-unknown-unknown %s -fembed-bitcode -o %t.o | ||
// RUN: llvm-readobj -S %t.o | FileCheck --check-prefix=CHECK %s | ||
// CHECK: Name: .llvmbc | ||
// CHECK: Name: .llvmcmd |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1688,6 +1688,14 @@ static const Comdat *getWasmComdat(const GlobalValue *GV) { | |
} | ||
|
||
static SectionKind getWasmKindForNamedSection(StringRef Name, SectionKind K) { | ||
// Certain data sections we treat as named custom sections rather than | ||
// segments within the data section. | ||
// This could be avoided if all data segements (the wasm sense) were | ||
// represented as thier own sections (in the llvm sense). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. *their There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I went ahead and fixed that upstream: llvm@5a0d8c3 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I'm not authoring this code, I'm just cherry-picking from upstream. |
||
// TODO(sbc): https://github.com/WebAssembly/tool-conventions/issues/138 | ||
if (Name == ".llvmcmd" || Name == ".llvmbc") | ||
return SectionKind::getMetadata(); | ||
|
||
// If we're told we have function data, then use that. | ||
if (K.isText()) | ||
return SectionKind::getText(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, somehow you chopped the first line of this comment, but it's there on #49...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh oops, this didn't merge cleanly in both cases and it looks like I botched this merged but didn't botch the other. Should be fixed now!