bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/22394] New: hppa-linux-ld fails to emit dynamic relocations on f


From: amodra at gmail dot com
Subject: [Bug ld/22394] New: hppa-linux-ld fails to emit dynamic relocations on function pointer initialization
Date: Sat, 04 Nov 2017 00:02:49 +0000

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

            Bug ID: 22394
           Summary: hppa-linux-ld fails to emit dynamic relocations on
                    function pointer initialization
           Product: binutils
           Version: 2.30 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: amodra at gmail dot com
  Target Milestone: ---

gcc -mfast-indirect-calls emits a function pointer initialization without a P%
(plabel) modifier.  ld does not create the necessary dynamic relocations for
this to work.

$ cat funcp.c
extern void foo(void);
void (*fp)(void) = foo;

int main()
{
  fp();
  return 0;
}
$ cat funcpdef.c 
void foo(void) {}
$ gcc -shared -o funcpdef.so funcpdef.c
$ gcc -o funcp funcp.c funcpdef.so -Wl,-rpath=.
$ ./funcp
$ gcc -o funcp funcp.c funcpdef.so -Wl,-rpath=. -mfast-indirect-calls
$ ./funcp
Segmentation fault (core dumped)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]