bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/19818] Absolute symbol is handled incorrectly in PIE


From: hjl.tools at gmail dot com
Subject: [Bug ld/19818] Absolute symbol is handled incorrectly in PIE
Date: Sun, 13 Mar 2016 15:26:04 +0000

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

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
More tests

address@hidden tmp]$ cat foo.c
#include <stdio.h>

extern char foo;
void *p = &foo;

int
main ()
{
  printf ("%p\n", p);
  printf ("%p\n", &foo);
  return 0;
}
address@hidden tmp]$ gcc -fPIE foo.c -c   
address@hidden tmp]$ gcc foo.o -Wl,--defsym,foo=0x1000
address@hidden tmp]$ ./a.out 
0x1000
0x1000
address@hidden tmp]$ gcc foo.o -Wl,--defsym,foo=0x1000 -pie
address@hidden tmp]$ ./a.out 
0x557f7dd83000
0x557f7dd83000
address@hidden tmp]$

-- 
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]