dtolnay / linkme

Safe cross-platform linker shenanigans

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't create dynamic relocation against local symbol in readonly segment

arcnmx opened this issue · comments

On my machine the example test fails to link on lld 8.0:

note: ld.lld: error: can't create dynamic relocation R_X86_64_64 against local symbol in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in /.../debug/deps/example-56d39e659ef87805.3p5k1gwcovuwpn4a.rcgu.o
>>> referenced by 3p5k1gwcovuwpn4a
>>>               /.../debug/deps/example-56d39e659ef87805.3p5k1gwcovuwpn4a.rcgu.o:(example::BENCH_DESERIALIZE::h28653d3b093a8cd3)

There's some nuance to this that I'm not really up to diving into right now.