[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gas/16858] weak external reference has wrong value
From: |
bernd.edlinger at hotmail dot de |
Subject: |
[Bug gas/16858] weak external reference has wrong value |
Date: |
Tue, 29 Apr 2014 14:37:12 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=16858
Bernd Edlinger <bernd.edlinger at hotmail dot de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |---
--- Comment #10 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
Hi, I installed your patch on a 2.24 binutils, and
I am still having trouble with the following example:
(on i686-cygwin-32)
$ gcc test0.c
$ ./a
hello
weak
hello
weak
hello
weak
hello
weak
hello
weak
...
$ gcc test0.c test1.c
$ ./a
hello
strong
Segmentation fault (Speicherabzug geschrieben)
the first direct call to test is OK now, but the second
using pointer (weak reference!) still does not work.
I am afraid the second use-case is what GCC will use.
$ cat test0.c
#include <stdio.h>
extern void test() __attribute__((weak));
int main()
{
void (*f)();
printf("hello\n");
test();
f = &test;
if (f != NULL)
(*f)();
else
printf("no weak\n");
return 0;
}
#if 1
//__attribute__((weak,section("test1")))
void test()
{
printf("weak\n");
}
#endif
$ cat test1.c
#include <stdio.h>
void test()
{
printf("strong\n");
}
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug gas/16858] weak external reference has wrong value, (continued)
- [Bug gas/16858] weak external reference has wrong value, bernd.edlinger at hotmail dot de, 2014/04/21
- [Bug gas/16858] weak external reference has wrong value, bernd.edlinger at hotmail dot de, 2014/04/21
- [Bug gas/16858] weak external reference has wrong value, address@hidden, 2014/04/21
- [Bug gas/16858] weak external reference has wrong value, mikpelinux at gmail dot com, 2014/04/21
- [Bug gas/16858] weak external reference has wrong value, mikpelinux at gmail dot com, 2014/04/23
- [Bug gas/16858] weak external reference has wrong value, nickc at redhat dot com, 2014/04/25
- [Bug gas/16858] weak external reference has wrong value, nickc at redhat dot com, 2014/04/25
- [Bug gas/16858] weak external reference has wrong value, mikpelinux at gmail dot com, 2014/04/27
- [Bug gas/16858] weak external reference has wrong value, cvs-commit at gcc dot gnu.org, 2014/04/28
- [Bug gas/16858] weak external reference has wrong value, nickc at redhat dot com, 2014/04/28
- [Bug gas/16858] weak external reference has wrong value,
bernd.edlinger at hotmail dot de <=