[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/18900] New: Unnecessary PLT entry for function pointer initializ
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug ld/18900] New: Unnecessary PLT entry for function pointer initialization |
Date: |
Mon, 31 Aug 2015 02:41:33 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=18900
Bug ID: 18900
Summary: Unnecessary PLT entry for function pointer
initialization
Product: binutils
Version: 2.26 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: ld
Assignee: unassigned at sourceware dot org
Reporter: hjl.tools at gmail dot com
Target Milestone: ---
address@hidden no-plt-3]$ cat x.c
extern void foo (void);
void (*p) (void) = &foo;
int
main ()
{
p ();
return 0;
}
address@hidden no-plt-3]$ cat foo.c
#include <stdio.h>
void
foo (void)
{
printf ("OK\n");
}
address@hidden no-plt-3]$ make
gcc -g -c -o x.o x.c
gcc -g -fPIC -c -o foo.o foo.c
ld -shared -o libfoo.so foo.o
gcc -o x x.o libfoo.so -Wl,-rpath,.
./x
OK
readelf -r x
Relocation section '.rela.dyn' at offset 0x3d0 contains 1 entries:
Offset Info Type Sym. Value Sym. Name +
Addend
000000600958 000200000006 R_X86_64_GLOB_DAT 0000000000000000 __gmon_start__ +
0
Relocation section '.rela.plt' at offset 0x3e8 contains 2 entries:
Offset Info Type Sym. Value Sym. Name +
Addend
000000600978 000100000007 R_X86_64_JUMP_SLO 0000000000000000
address@hidden + 0
000000600980 000400000007 R_X86_64_JUMP_SLO 0000000000400460 foo + 0
address@hidden no-plt-3]$
--
You are receiving this mail because:
You are on the CC list for the bug.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug ld/18900] New: Unnecessary PLT entry for function pointer initialization,
hjl.tools at gmail dot com <=