aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2015-09-25 01:59:13 +0000
committerDavide Italiano <davide@freebsd.org>2015-09-25 01:59:13 +0000
commitaa7c533ec326465523021960e315999db15673a2 (patch)
tree3af758416dacd850b94483633b18afe103e2f078 /lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
parent8aa9973696abce5afcff1f95a1fd417735a9c02f (diff)
downloadllvm-aa7c533ec326465523021960e315999db15673a2.zip
llvm-aa7c533ec326465523021960e315999db15673a2.tar.gz
llvm-aa7c533ec326465523021960e315999db15673a2.tar.bz2
[ELF2] Fix binaries so they actually run on FreeBSD.
Since FreeBSD 4.1, the kernel expects binaries to be marked with ELFOSABI_FREEBSD in the ELF header to exec() them. LLD unconditionally sets OSABI to ELF_OSABINONE, and everything linked with it won't run on FreeBSD (unless explicitly rebranded). Example: % ./aarch64-hello ELF binary type "0" not known. zsh: exec format error: ./aarch64-hello FreeBSD could be modified to accept ELF_OSABINONE, but that would break all existing binaries, so the kernel needs to support both ABINONE and ABIFREEBSD. I plan to push this change in FreeBSD one day, which, unfortunately, is not today. This code patches lld so it sets the header field correctly. For completeness, the rationale of this change is explained in the FreeBSD commit message, and it's apparently to pleasee binutils maintainers at the time. https://svnweb.freebsd.org/base?view=revision&revision=59342 Differential Revision: http://reviews.llvm.org/D13140 llvm-svn: 248554
Diffstat (limited to 'lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp')
0 files changed, 0 insertions, 0 deletions