This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/37454] New: gcc: unrecognized option '-rdynamic'


gcc doesn't know -rdynamic option

>From gcc-4.3.1 man page
     -rdynamic
         Pass the flag -export-dynamic to the ELF linker, on
         targets that support it. This instructs the linker to
         add all symbols, not only used ones, to the dynamic
         symbol table. This option is needed for some uses of
         "dlopen" or to allow obtaining backtraces from within a
         program.

>From ld 2.18 man page
     --export-dynamic
         When creating a dynamically linked executable,  add  all
         symbols to the dynamic symbol table.  The dynamic symbol
         table is the set  of  symbols  which  are  visible  from
         dynamic objects at run time.

So I believe that gcc should know "-rdynamic"

My fix was to add the following line to the #define LINK_SPEC in the file
gcc-4.3.1/gcc/config/sol2.h at line 145:
    %{rdynamic:--export-dynamic} \

OS and tools
SunOS solaris 5.11 snv_95 i86pc i386 i86pc Solaris
gcc (GCC) 4.3.1
ld (GNU Binutils) 2.18


-- 
           Summary: gcc: unrecognized option '-rdynamic'
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: YLitvinenko at astana dot oilfield dot slb dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37454


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]