Browse Source

Add linker's --export-dynamic flag alias

Since 9336fa7ae50ef60cb0049136a7831e7e8d94a20a --export-dynamic is
supported. Add this conventional flag as alias.
Andrey Gursky 1 year ago
parent
commit
91bdb5a4a3
3 changed files with 8 additions and 0 deletions
  1. 2 0
      libtcc.c
  2. 5 0
      tcc-doc.texi
  3. 1 0
      tcc.c

+ 2 - 0
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)) {

+ 5 - 0
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.
 

+ 1 - 0
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