c - What's the difference between the -symbolic and -shared GCC flags? -
With the description of the documentation, they do the same thing, except that "not all systems" support was shared and " Only a few systems "this symbolic support (it is not clear that this is the same group of systems):
- Create a shared object, which is to make an executable Items can be added to all systems do not support this option. For taxable results, you must specify the same set of options used to generate alternative specified time code (-fpic, -fPIC, or model suboptions). [1]
- Symbolic bind reference for global symbols when creating a shared object. Warn about any unsolved references (unless the link editor option is overridden by Xlinker -z-Xlinker defs) only some systems support this option.
I suspect that "a shared object is formed that can be added to make an executable from another object", but it seems that about any library Does this mean that the resulting object can be linked statically?
summary: -Sambulique intra-shared object function exchange
Linking to the shared object allows the symbol to be a feature called interpcine. The idea is that you can 'enterpus' a new definition of a global symbol so that it is called 'regular' definition.
A classic example is malloc () in the most common case, malloc () is defined in libc. But you can interfere with your own version by loading your library, which defines that symbol before loading libc (Most Runtime Linkers will use LD_PRELOAD in specific libraries to load before you execute )
By default, any function within the shared object is not static, which is a global symbol. Because of that, any function within the shared object can be interpozed. Consider a scenario where a shared object calls high_level () and low_level () and high_level () as low-level () calls as part of the implementation and neither have high_level () nor low_level () fixed functions.
It is possible to interfere with low_level (), such as high_level () calling less_level () than a different shared object.
This is where the syngsi comes. Object, the linker will see that low_level () is defined in the same shared object as hyolide () and tie the call as if it can not be interpozed. In this way, you know that any call from your shared object will never be interfered to share any other in a single shared object.
Comments
Post a Comment