Skip to content

Commit

Permalink
Linking: Include export lists in debug output.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwoerister committed Dec 5, 2016
1 parent e48160f commit bfd4910
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/librustc_trans/back/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,14 @@ impl<'a> Linker for GnuLinker<'a> {
let mut arg = OsString::new();
let path = tmpdir.join("list");

debug!("EXPORTED SYMBOLS:");

if self.sess.target.target.options.is_like_osx {
// Write a plain, newline-separated list of symbols
let res = (|| -> io::Result<()> {
let mut f = BufWriter::new(File::create(&path)?);
for sym in self.info.exports[&crate_type].iter() {
debug!(" _{}", sym);
writeln!(f, "_{}", sym)?;
}
Ok(())
Expand All @@ -271,6 +274,7 @@ impl<'a> Linker for GnuLinker<'a> {
let mut f = BufWriter::new(File::create(&path)?);
writeln!(f, "{{\n global:")?;
for sym in self.info.exports[&crate_type].iter() {
debug!(" {};", sym);
writeln!(f, " {};", sym)?;
}
writeln!(f, "\n local:\n *;\n}};")?;
Expand Down

0 comments on commit bfd4910

Please sign in to comment.