Skip to content

Commit 3bf7130

Browse files
committedFeb 15, 2017
Make --export-dynamic work on non-PIC/PIE targets.
For CloudABI I'm only interested in generating non-PIC/PIE executables on armv6 and i686, as PIE introduces larger overhead than on aarch64 and x86_64. Still, I want to be able to instruct the linker to generate a dynamic symbol table if requested. One example use for this is that dynamic symbol tables can be used by programs to print nicely formatted stacktraces, including symbol names. Right now there seems to be some logic in LLD that it only wants to emit dynamic symbol tables when either linking against libraries or when building PIC. Let's extend this to also take --export-dynamic into account. Reviewed by: ruiu Differential Revision: https://reviews.llvm.org/D29982 llvm-svn: 295240
1 parent d122abe commit 3bf7130

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎lld/ELF/Writer.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,8 @@ template <class ELFT> void Writer<ELFT>::createSyntheticSections() {
354354

355355
// Add MIPS-specific sections.
356356
bool HasDynSymTab =
357-
!Symtab<ELFT>::X->getSharedFiles().empty() || Config->pic();
357+
!Symtab<ELFT>::X->getSharedFiles().empty() || Config->pic() ||
358+
Config->ExportDynamic;
358359
if (Config->EMachine == EM_MIPS) {
359360
if (!Config->Shared && HasDynSymTab) {
360361
In<ELFT>::MipsRldMap = make<MipsRldMapSection<ELFT>>();

0 commit comments

Comments
 (0)
Please sign in to comment.