[Bug ld/23078] Weak alias to a weak symbol is not resolved correctly.
https://sourceware.org/bugzilla/show_bug.cgi?id=23078 Alan Modra changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED CC||amodra at gmail dot com Resolution|--- |INVALID --- Comment #3 from Alan Modra --- Not a linker bug, and original reporter has probably figured out what is wrong with his code by now. In an case, asking binutils developers how to use gcc features via a bug report is not appropriate. -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug ld/23078] Weak alias to a weak symbol is not resolved correctly.
https://sourceware.org/bugzilla/show_bug.cgi?id=23078 --- Comment #2 from Vadzim Dambrouski --- Hello Nick, Thank you for suggestion, I've tried weakref, and does help with the case I have posted above, but it still doesn't do exactly what I need. Here is updated code: // main.c --- void _start() {} void DEFAULT_HANDLER() { *((int*)0x10) = 5; } void BUS_FAULT() { *((int*)0x10) = 7; } // foo.c __attribute__((weak)) void DEFAULT_HANDLER() { *((int*)0x10) = 1; } static __attribute__((weakref ("DEFAULT_HANDLER"))) void HARD_FAULT(); static __attribute__((weakref ("DEFAULT_HANDLER"))) void BUS_FAULT(); void (*VECTORS[])() = { HARD_FAULT, BUS_FAULT, }; // -- In this new example I have created a strong symbols for both default handler and for one of specific handlers. I expect that VECTORS table would contain pointers to functions 5 and 7, but in practice it contains pointers to 5 and 5. This is not what I need, unfortunately. Regards, Vadzim -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug ld/23078] Weak alias to a weak symbol is not resolved correctly.
https://sourceware.org/bugzilla/show_bug.cgi?id=23078 Nick Clifton changed: What|Removed |Added CC||nickc at redhat dot com --- Comment #1 from Nick Clifton --- Hi Vadzim, > VECTORS array points to a weak function instead of a strong function defined > in main.c I think that this is a bug in your test code. You should be using the weakref attribute here, rather than the weak and alias attributes. IE: static __attribute__((weakref ("DEFAULT_HANDLER"))) void HARD_FAULT (); and similarly for BUS_FAULT. Cheers Nick -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils