diff options
| author | ILyoan <ilyoan@gmail.com> | 2013-03-13 17:22:01 +0900 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-04-10 18:49:51 -0700 |
| commit | 344628fe91ffa0fad32bc5b3eee3e6b4b48c9990 (patch) | |
| tree | 688414e569707818bd137d47543b73e619d65eb4 /src/librustc/metadata | |
| parent | 3d0d144283959bf62368f6965aae14ce95ee286b (diff) | |
| download | rust-344628fe91ffa0fad32bc5b3eee3e6b4b48c9990.tar.gz rust-344628fe91ffa0fad32bc5b3eee3e6b4b48c9990.zip | |
FIX meta_section_name for macos
Diffstat (limited to 'src/librustc/metadata')
| -rw-r--r-- | src/librustc/metadata/loader.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/librustc/metadata/loader.rs b/src/librustc/metadata/loader.rs index 9c612056677..cfe9c8cd40a 100644 --- a/src/librustc/metadata/loader.rs +++ b/src/librustc/metadata/loader.rs @@ -206,7 +206,8 @@ fn get_metadata_section(os: os, while llvm::LLVMIsSectionIteratorAtEnd(of.llof, si.llsi) == False { let name_buf = llvm::LLVMGetSectionName(si.llsi); let name = unsafe { str::raw::from_c_str(name_buf) }; - if name == meta_section_name(os) { + debug!("get_matadata_section: name %s", name); + if name == read_meta_section_name(os) { let cbuf = llvm::LLVMGetSectionContents(si.llsi); let csz = llvm::LLVMGetSectionSize(si.llsi) as uint; let mut found = None; @@ -251,6 +252,16 @@ pub fn meta_section_name(os: os) -> ~str { } } +pub fn read_meta_section_name(os: os) -> ~str { + match os { + os_macos => ~"__note.rustc", + os_win32 => ~".note.rustc", + os_linux => ~".note.rustc", + os_android => ~".note.rustc", + os_freebsd => ~".note.rustc" + } +} + // A diagnostic function for dumping crate metadata to an output stream pub fn list_file_metadata(intr: @ident_interner, os: os, |
