[llvm-bugs] [Bug 36678] Cannot use a regular plt entry for R_386_PC32 with -pie/-shared

via llvm-bugs llvm-bugs at lists.llvm.org
Wed May 22 19:26:39 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=36678

Fangrui Song <i at maskray.me> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|CONFIRMED                   |RESOLVED
                 CC|                            |i at maskray.me
         Resolution|---                         |FIXED

--- Comment #1 from Fangrui Song <i at maskray.me> ---
Fixed by r327542

% ld.lld -shared a.o b.so -o a
ld.lld: error: relocation R_386_PC32 cannot be used against symbol foo;
recompile with -fPIC
>>> defined in b.so
>>> referenced by a.o:(.text+0x1)

% ld.lld -pie a.o b.so -o a
ld.lld: error: symbol 'foo' cannot be preempted; recompile with -fPIE
>>> defined in b.so
>>> referenced by a.o:(.text+0x1)

With -z notext, a text relocation R_386_PC32 is created.

% ld.bfd -m elf_i386 -pie a.o b.so -o a -z text
ld.bfd: a.o: warning: relocation against `foo' in read-only section `.text'
ld.bfd: read-only segment has dynamic relocations.
% ld.bfd -m elf_i386 -shared a.o b.so -o a -z text
ld.bfd: a.o: warning: relocation against `foo' in read-only section `.text'
ld.bfd: read-only segment has dynamic relocations.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190523/2737e7f4/attachment.html>


More information about the llvm-bugs mailing list