Using _symval() vs. Weak Symbol References

On C7000 devices, all symbol references are handled in a position-independent manner through a PC-relative offset. However, linker-defined symbols may have a value that does not resolve to a valid symbol address. When accessing such symbols, you must use the _symval() intrinsic to force the use of absolute addressing as described in the previous section.

If a symbol may resolve to either a valid address or a single non-address value, you are encouraged to use weak symbol references. A weak symbol reference may be unresolved at link time, in which case the address is treated as 0. Therefore, for weak references, application code must test to make sure &var is not zero before attempting to read the contents. Using weak symbol references preserves the position independence of the system, while allowing for cases in which the symbol may resolve to a non-address value (in this case, "0" if the symbol is unresolved at link time).