Skip to content
Commit b5711025 authored by Fangrui Song's avatar Fangrui Song
Browse files

x86_64: Remove unneeded static PIE check for undefined weak diagnostic

https://sourceware.org/bugzilla/show_bug.cgi?id=21782

 dropped an ld
diagnostic for R_X86_64_PC32 referencing an undefined weak symbol in
-pie links.  Arguably keeping the diagnostic like other ports is more
correct, since statically resolving movl foo(%rip), %eax to the
link-time zero address produces a corrupted output.

It turns out that --enable-static-pie builds do not depend on the ld
behavior. GCC generates GOT indirection for weak declarations for
-fPIE/-fPIC, so what ld does with the PC-relative relocation doesn't
really matter.

Reviewed-by: default avatarH.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit 115d2424)
parent edfd1119
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment