From 91bdb5a4a32d8b2c994ebaeaa330807e72693d4b Mon Sep 17 00:00:00 2001 From: Andrey Gursky Date: Mon, 11 Jun 2018 18:15:24 +0200 Subject: [PATCH] Add linker's --export-dynamic flag alias Since 9336fa7ae50ef60cb0049136a7831e7e8d94a20a --export-dynamic is supported. Add this conventional flag as alias. --- libtcc.c | 2 ++ tcc-doc.texi | 5 +++++ tcc.c | 1 + 3 files changed, 8 insertions(+) diff --git a/libtcc.c b/libtcc.c index 0b154c78..48ce76d4 100644 --- a/libtcc.c +++ b/libtcc.c @@ -1365,6 +1365,8 @@ static int tcc_set_linker(TCCState *s, const char *option) ignoring = 1; } else if (link_option(option, "export-all-symbols", &p)) { s->rdynamic = 1; + } else if (link_option(option, "export-dynamic", &p)) { + s->rdynamic = 1; } else if (link_option(option, "rpath=", &p)) { copy_linker_arg(&s->rpath, p, ':'); } else if (link_option(option, "enable-new-dtags", &p)) { diff --git a/tcc-doc.texi b/tcc-doc.texi index 5e718a2c..fc07c12c 100644 --- a/tcc-doc.texi +++ b/tcc-doc.texi @@ -322,6 +322,11 @@ Binary image (only for executable output) COFF output format (only for executable output for TMS320C67xx target) @end table +@item -Wl,--export-all-symbols +@item -Wl,--export-dynamic +Export global symbols to the dynamic linker. It is useful when a library +opened with @code{dlopen()} needs to access executable symbols. + @item -Wl,-subsystem=console/gui/wince/... Set type for PE (Windows) executables. diff --git a/tcc.c b/tcc.c index 88a441de..aa4b816e 100644 --- a/tcc.c +++ b/tcc.c @@ -117,6 +117,7 @@ static const char help2[] = " -nostdlib do not link with standard crt/libs\n" " -[no-]whole-archive load lib(s) fully/only as needed\n" " -export-all-symbols same as -rdynamic\n" + " -export-dynamic same as -rdynamic\n" " -image-base= -Ttext= set base address of executable\n" " -section-alignment= set section alignment in executable\n" #ifdef TCC_TARGET_PE -- 2.11.4.GIT