Skip to content

mold tests failed with unversioned symbols #1534

@hjl-tools

Description

@hjl-tools

mold tests failed using ld with the fix for

https://sourceware.org/bugzilla/show_bug.cgi?id=33577
+ cc -B. -o out/test/x86_64/wrap-lto/exe out/test/x86_64/wrap-lto/a.so out/test/x86_64/wrap-lto/b.o -flto
mold: error: undefined symbol: foo
>>> referenced by <artificial>
>>>               /tmp/ccJUq1KE.ltrans0.ltrans.o:(main)
collect2: error: ld returned 1 exit status

Before the PR ld/33577 fix:

/tmp/a.so:     file format elf64-x86-64

DYNAMIC SYMBOL TABLE:
0000000000000000  w   D  *UND*	0000000000000000  Base        _ITM_deregisterTMCloneTable
0000000000000000  w   D  *UND*	0000000000000000  Base        __gmon_start__
0000000000000000  w   D  *UND*	0000000000000000  Base        _ITM_registerTMCloneTable
0000000000000000  w   DF *UND*	0000000000000000 (GLIBC_2.2.5) __cxa_finalize
0000000000000396 g    DF .text	000000000000000d  Base        bar
0000000000000389 g    DF .text	000000000000000d  Base        foo

After the fix:

/tmp/a.so:     file format elf64-x86-64

DYNAMIC SYMBOL TABLE:
0000000000000000  w   D  *UND*	0000000000000000              _ITM_deregisterTMCloneTable
0000000000000000  w   D  *UND*	0000000000000000              __gmon_start__
0000000000000000  w   D  *UND*	0000000000000000              _ITM_registerTMCloneTable
0000000000000000  w   DF *UND*	0000000000000000 (GLIBC_2.2.5) __cxa_finalize
0000000000000396 g    DF .text	000000000000000d              bar
0000000000000389 g    DF .text	000000000000000d              foo

The difference is that unversioned symbols no longer have the Base version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions