https://sourceware.org/bugzilla/show_bug.cgi?id=20159
Bug ID: 20159
Summary: Dynamic Linking Change for Shared Libraries (1.24 to
1.26)
Product: binutils
Version: 2.26
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: ld
Assignee: unassigned at sourceware dot org
Reporter: paul.braman at nielsen dot com
Target Milestone: ---
I get different results in Ubuntu 14.04 (GCC 4.8.4/GNU ld 2.24) and Ubuntu
16.04 (GCC 5.3.1/GNU ld 2.26) when building the following test code:
nothing.c:
#include <stdio.h>
#include <time.h>
void nothing( )
{
printf( "%lld\n", (long long)time( NULL ) );
}
something.c:
#include <stdio.h>
#include <time.h>
extern void nothing( void );
int main( )
{
printf( "%lld\n", (long long)time( NULL ) );
nothing( );
return 0;
}
faketime.c:
#include <time.h>
time_t time( time_t * ptr )
{
return 42;
}
... using the commands:
gcc -fPIC -c -o nothing.lo nothing.c
gcc -shared -rdynamic -o libnothing.so nothing.lo
gcc -o something something.c faketime.c -Wl,-rpath=. -L. -lnothing
Ubuntu 14.04 says the answer is "42/42" while Ubuntu 16.04 says the answer is
"42/1464287587" (insert your current Unix timestamp).
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-binutils