[PATCH] D24060: [lld][ELF] Add support for -b binary

Ed Maste via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 7 11:16:46 PDT 2016


emaste added inline comments.

================
Comment at: ELF/InputFiles.cpp:724
@@ +723,3 @@
+    [](char C) { return isalnum(C) ? C : '_'; });
+  std::string StartSym = "_binary_" + Filename + "_start";
+  std::string EndSym = "_binary_" + Filename + "_end";
----------------
rafael wrote:
> These names look wrong. With gold and bfd I get
> 
> _binary__home_espindola_llvm_build_tools_lld_test_ELF_Output_format_binary_test_tmp_binary_start
>  _binary__home_espindola_llvm_build_tools_lld_test_ELF_Output_format_binary_test_tmp_binary_size
>  _binary__home_espindola_llvm_build_tools_lld_test_ELF_Output_format_binary_test_tmp_binary_end
I believe it should be `_binary_` + //alnum_pathname// + {`_start`, `_end`, `_size`}, where //alnum_pathname// is the full pathname passed to the linker with non-alnum characters replaced by `_`.


https://reviews.llvm.org/D24060





More information about the llvm-commits mailing list