
#15723: -prof -fPIC -fexternal-dynamic-refs generates non-PIC relocations for external symbol -------------------------------------+------------------------------------- Reporter: watashi | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.1 (CodeGen) | Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by watashi): * cc: simonmar (added) Old description:
When compiling code with `-prof -fPIC -fexternal-dynamic-refs`, the generated object file may contains R_X86_64_PC32 relocation to symbols defined in another object file.
will add more details
New description:
When compiling code with `-prof -fPIC -fexternal-dynamic-refs`, the
generated object file may contains R_X86_64_PC32 relocation to symbols
defined in another object file.
{{{
$ cat T15723A.hs T15723B.hs
module T15723A where
{-# INLINE foo #-}
foo :: Int -> Int
foo x = {-# SCC foo1 #-} bar x
{-# NOINLINE bar #-}
bar :: Int -> Int
bar x = x
module T15723B where
import T15723A
test :: Int -> Int
test x = {-# SCC test1 #-} foo $ foo x
$ $HC -prof -prof -fPIC -fexternal-dynamic-refs -O2 -c T15723A.hs
$ $HC -prof -prof -fPIC -fexternal-dynamic-refs -O2 -c T15723B.hs
$ objdump -rdS T15723B.o | less
0000000000000028