Skip to content

Commit 344628f

Browse files
ILyoanbrson
authored andcommitted
FIX meta_section_name for macos
1 parent 3d0d144 commit 344628f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/librustc/metadata/loader.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ fn get_metadata_section(os: os,
206206
while llvm::LLVMIsSectionIteratorAtEnd(of.llof, si.llsi) == False {
207207
let name_buf = llvm::LLVMGetSectionName(si.llsi);
208208
let name = unsafe { str::raw::from_c_str(name_buf) };
209-
if name == meta_section_name(os) {
209+
debug!("get_matadata_section: name %s", name);
210+
if name == read_meta_section_name(os) {
210211
let cbuf = llvm::LLVMGetSectionContents(si.llsi);
211212
let csz = llvm::LLVMGetSectionSize(si.llsi) as uint;
212213
let mut found = None;
@@ -251,6 +252,16 @@ pub fn meta_section_name(os: os) -> ~str {
251252
}
252253
}
253254
255+
pub fn read_meta_section_name(os: os) -> ~str {
256+
match os {
257+
os_macos => ~"__note.rustc",
258+
os_win32 => ~".note.rustc",
259+
os_linux => ~".note.rustc",
260+
os_android => ~".note.rustc",
261+
os_freebsd => ~".note.rustc"
262+
}
263+
}
264+
254265
// A diagnostic function for dumping crate metadata to an output stream
255266
pub fn list_file_metadata(intr: @ident_interner,
256267
os: os,

0 commit comments

Comments
 (0)