[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/18458] New: -z now generates wrong binary
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug ld/18458] New: -z now generates wrong binary |
Date: |
Wed, 27 May 2015 21:11:21 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=18458
Bug ID: 18458
Summary: -z now generates wrong binary
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 gotplt-4]$ cat a.c
#include <stdio.h>
void
a (void)
{
printf("Hello, World!\n");
}
address@hidden gotplt-4]$ cat b.c
extern void a (void);
void
b (void)
{
a();
}
address@hidden gotplt-4]$ cat main.c
extern void a(void);
extern void b(void);
void dummy (void)
{
a();
}
int
compare (void (*f)(void))
{
return a == f;
}
int
main (void)
{
b ();
return 0;
}
address@hidden gotplt-4]$ make
gcc -m32 -O -g -c -o main.o main.c
gcc -m32 -O -g -fpic -o a.o -c a.c
gcc -m32 -O -g -Wl,-z,now -shared -o a.so a.o
gcc -m32 -O -g -fpic -o b.o -c b.c
gcc -m32 -O -g -Wl,-z,now -shared -o b.so b.o a.so
gcc -m32 -O -g -Wl,-rpath=. -Wl,-z,now -o main main.o a.so b.so
address@hidden gotplt-4]$ ./main
"main" enters an infinite loop.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/18458] New: -z now generates wrong binary,
hjl.tools at gmail dot com <=