Skip to content

lto and optimised out symbols #136493

Open
Open
@ilobilo

Description

@ilobilo

I'm compiling and linking my project with full lto.

During runtime, the executable reads and parses its own symbol table and uses those entries for loading shared objects. Unfortunately, lto optimises out some of those symbols, so those objects can not be relocated and loaded. I can mark each unresolved symbol with [[gnu::used]], but I don't have access to many of them, as they are from external projects.

I'm wondering, is there a way to force the linker to not remove/optimise out symbols from the target executable?

Metadata

Metadata

Assignees

No one assigned

    Labels

    LTOLink time optimization (regular/full LTO or ThinLTO)questionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions