Joerg Wunsch schrieb:
As Dale wrote:

The issue then is the case of a library that contains an ISR.

That's correct.  In this case, you have to cause an explicit undefined
reference to it, in order to make the linker even consider pulling the
library module.

Doesn't the linker look in the libraries if it finds a non-weak definition for a weak symbol?

__vector_8 is defined weak in .vectors (gcrt1.S, i,e, crt*.o) and defined there as __bad_interrupt. Is that sufficient to stop the linker from dearching for overrides of __vector_8?

Johann

In addition to placing another (referenced) symbol
into the same module, this might be done using the -u linker option:
suppose, my __vector_8 function where placed in a library, the
respective (compiler) commandline switch would be "-Wl,-u,__vector_8".
This makes the symbol "__vector_8" a "global undefined" straight from
the beginning, so pulling the library module in satisfies that
reference to the linker.


_______________________________________________
AVR-libc-dev mailing list
AVR-libc-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev

Reply via email to