[llvm] [BOLT] Ignore duplicate global symbols (PR #201082)

Jinjie Huang via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 2 03:27:57 PDT 2026


Jinjie-Huang wrote:

Here is what the symbol table looks like for the given case:
```
readelf -sW duplicate_symbols.test.tmp.so

Symbol table '.dynsym' contains 6 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 0000000000001418    11 FUNC    GLOBAL DEFAULT    8 _start
     2: 0000000000001423     2 FUNC    GLOBAL DEFAULT    8 foo_v1
     3: 0000000000001425     1 FUNC    GLOBAL DEFAULT    8 foo_v2
     4: 0000000000001423     2 FUNC    GLOBAL DEFAULT    8 foo at VERS_1
     5: 0000000000001425     1 FUNC    GLOBAL DEFAULT    8 foo@@VERS_2

Symbol table '.symtab' contains 7 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 0000000000002460     0 NOTYPE  LOCAL  HIDDEN    10 _DYNAMIC
     2: 0000000000001418    11 FUNC    GLOBAL DEFAULT    8 _start
     3: 0000000000001423     2 FUNC    GLOBAL DEFAULT    8 foo_v1
     4: 0000000000001425     1 FUNC    GLOBAL DEFAULT    8 foo_v2
     5: 0000000000001423     2 FUNC    GLOBAL DEFAULT    8 foo
     6: 0000000000001425     1 FUNC    GLOBAL DEFAULT    8 foo
```

https://github.com/llvm/llvm-project/pull/201082


More information about the llvm-commits mailing list