Support of --noinhibit-exec flag implemented.
Diff Detail
Event Timeline
ELF/Writer.cpp | ||
---|---|---|
307–309 | "A Twine is not intended for use directly and should not be stored, its implementation relies on the ability to store pointers to temporary stack objects which may be deallocated at the end of a statement" (http://llvm.org/docs/doxygen/html/classllvm_1_1Twine.html#details) So make this an std::string rather than a Tiwne. |
BTW, is this guaranteed to be safe? I think we currently do not expect any undefined symbols to appear in Writer because we abort early if such symbol exists. This patch changes that assumption.
In COFF, we overwrite undefined symbols with absolute symbols with value 0 if /force (Windows option for -no-inhibit-exec). Maybe we should do that?
Rafael?
Just a few fixes.
This should be fine from the writer perspective since we are already handling weak undefined symbols.
ELF/Writer.cpp | ||
---|---|---|
4 | I think you can write this as std::string Error = "undefined symbol: " + Sym.getName(); Error += " in " ... | |
test/elf2/no-inhibit-exec.s | ||
3 | Also run llvm-objdump -d to check what we produce. | |
12 | You don't need this part |
test/elf2/no-inhibit-exec.s | ||
---|---|---|
3 | Maybe check that both runs issue the same message? |
test/elf2/no-inhibit-exec.s | ||
---|---|---|
3 | That might be useful. Can update the patch with that later. |
I tried to apply it but failed:
git apply -p0 ~/Downloads/D13138.diff.txt
/Users/espindola/Downloads/D13138.diff.txt:9: trailing whitespace.
bool NoInhibitExec = false;
/Users/espindola/Downloads/D13138.diff.txt:21: trailing whitespace.
if (Args.hasArg(OPT_noinhibit_exec))
/Users/espindola/Downloads/D13138.diff.txt:22: trailing whitespace.
Config->NoInhibitExec = true;
/Users/espindola/Downloads/D13138.diff.txt:23: trailing whitespace.
/Users/espindola/Downloads/D13138.diff.txt:35: trailing whitespace.
#include "Config.h"
error: patch failed: ELF/Config.h:24
error: ELF/Config.h: patch does not apply
....
Can you email me a git generated patch directly?
I think you can write this as
std::string Error = "undefined symbol: " + Sym.getName();
if (SymFile)