https://sourceware.org/bugzilla/show_bug.cgi?id=24527
Bug ID: 24527 Summary: Linker GOLD: Symbols inside 'extern "C++"' or 'extern "Java"' in version scripts are not matched Product: binutils Version: 2.32 Status: UNCONFIRMED Severity: normal Priority: P2 Component: gold Assignee: ccoutant at gmail dot com Reporter: Arfrever.FTA at GMail dot Com CC: ian at airs dot com Target Milestone: --- $ cat test.s .data .globl C_data C_data: .text .globl C_text C_text: .data .globl CPLUSPLUS_data CPLUSPLUS_data: .text .globl CPLUSPLUS_text CPLUSPLUS_text: .data .globl JAVA_data JAVA_data: .text .globl JAVA_text JAVA_text: .data .globl XXX_1 XXX_1: .globl XXX_2 XXX_2: .text .globl XXX_3 XXX_3: .globl XXX_4 XXX_4: $ cat test.map { global: extern "C" { C_*; }; extern "C++" { CPLUSPLUS_*; }; extern "Java" { JAVA_*; }; local: *; }; $ gcc -fuse-ld=bfd -shared -Wl,--version-script=test.map -o test_bfd.so test.s $ gcc -fuse-ld=gold -shared -Wl,--version-script=test.map -o test_gold.so test.s $ Comparison between library built with linker BFD and library built with linker GOLD: $ diff -u10 <(nm test_bfd.so | sed -e "s/^[0-9a-f]\+ //") <(nm test_gold.so | sed -e "s/^[0-9a-f]\+ //") --- /dev/fd/63 +++ /dev/fd/62 @@ -1,30 +1,34 @@ -D CPLUSPLUS_data -T CPLUSPLUS_text +d CPLUSPLUS_data +t CPLUSPLUS_text D C_data T C_text -D JAVA_data -T JAVA_text +d JAVA_data +t JAVA_text d XXX_1 d XXX_2 t XXX_3 t XXX_4 d _DYNAMIC d _GLOBAL_OFFSET_TABLE_ w _ITM_deregisterTMCloneTable w _ITM_registerTMCloneTable r __FRAME_END__ d __TMC_END__ - w __cxa_finalize@@GLIBC_2.2.5 +d __TMC_LIST__ +t __bss_start + w __cxa_finalize t __do_global_dtors_aux t __do_global_dtors_aux_fini_array_entry d __dso_handle t __frame_dummy_init_array_entry w __gmon_start__ t __x86_indirect_thunk_rax t __x86_return_thunk +t _edata +t _end t _fini t _init b completed.7940 t deregister_tm_clones t frame_dummy t register_tm_clones $ All versions of linker GOLD (including current trunk) are affected. Problem originally found when building Protocol Buffers with GOLD: https://bugs.gentoo.org/683892 Protocol Buffers 3.7.1 has this version script which hides all symbols other than *google*: https://github.com/protocolbuffers/protobuf/blob/v3.7.1/src/libprotobuf.map -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils