https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69271
--- Comment #8 from Jan Hubicka ---
Ok, compiling:
int bar = 0;
extern int bar_alias __attribute__((weak, alias("bar")));
main()
{
printf ("%i %i\n",bar,bar_alias);
}
as a static library leads to no dynamic relocations, but compiling as shared
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69271
Rich Felker changed:
What|Removed |Added
CC||bugdal at aerifal dot cx
--- Comment #7 fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69271
--- Comment #6 from nsz at gcc dot gnu.org ---
to complete the example here is a test application:
#include
#include
extern char **environ;
int main()
{
printf("&environ: %p, environ: %p, *environ: %p\n", &environ, environ,
*environ);
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69271
--- Comment #5 from nsz at gcc dot gnu.org ---
copy pasting from
http://www.openwall.com/lists/musl/2016/01/13/2
(this is musl libc, but glibc has the same issue)
lto breaks symbol binding for environ, _environ, ___environ.
(they should be weak,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69271
--- Comment #4 from Jan Hubicka ---
The optimization was intentional - dropping the weak bit makes GCC to optimize
the references to symbol better (knowing it won't be NULL because the
definition
is provided). I wonder how this break glibc. What
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69271
Jan Hubicka changed:
What|Removed |Added
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69271
Richard Biener changed:
What|Removed |Added
Keywords||lto, wrong-code
CC|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69271
nsz at gcc dot gnu.org changed:
What|Removed |Added
Version|6.0 |5.3.1
--- Comment #1 from nsz at