Bug #1495
Relocation R_X86_64_PC32 error
Status: | New | Start date: | 09/23/2012 | |
---|---|---|---|---|
Priority: | Low | Due date: | ||
Assignee: | - | % Done: | 0% |
|
Category: | OS: GNU/Linux | |||
Target version: | - |
Description
When building on Debian with DEB_BUILD_MAINT_OPTIONS := hardening=+all, we got a lot of relocation R_X86_64_PC32 against undefined symbol... errors. Using -fPIC everywhere doesn't help.
The error seems to be related to "static" variables in headers so every singleton class can't be linked. Moving the variable in .cpp file fix the issue in some case.
History
#1 Updated by kervala almost 3 years ago
Apparently, adding __attribute__((visibility("hidden")))
to the variable could fix this issue.
Edit: The cause should be -fPIE used for libraries instead of executables