青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

Prayer

在一般中尋求卓越
posts - 1256, comments - 190, trackbacks - 0, articles - 0
  C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

Shared objects and run time linking

Posted on 2018-11-28 15:23 Prayer 閱讀(237) 評論(0)  編輯 收藏 引用 所屬分類: LINUX/UNIX/AIX
https://www.ibm.com/support/knowledgecenter/ssw_aix_71/com.ibm.aix.genprogc/shared_object_runtime_linking.htm

By default, programs are linked so that a reference to a symbol imported from a shared object is bound to that definition at load time.

This is true even if the program, or another shared object required by the program, defines the same symbol.

run time linker
A shared object that allows symbols to be rebound for appropriately linked programs

You include the run time linker in a program by linking the program with the -brtl option. This option has the following effects:

  • A reference to the run time linker is added to your program. When program execution begins, the startup code (/lib/crt0.o) will call the run time linker before the main function is called.
  • All input files that are shared objects are listed as dependents of your program in your program's loader section. The shared objects are listed in the same order as they were specified on the command line. This causes the system loader to loadall these shared objects so that the run time linker can use their definitions. If the -brtloption is not used, a shared object that is not referenced by the program is not listed, even if it provides definitions that might be needed by another shared object used by the program.
  • A shared object contained in an archive is only listed if the archive specifies automatic loading for the shared object member. You specify automatic loading for an archive member foo.o by creating a file with the following lines:
    # autoload #! (foo.o)復制
    and adding the file as a member to the archive.
  • In dynamic mode, input files specified with the -l flag may end in .so, as well as in .a. That is, a reference to -lfoois satisfied by the first libfoo.so or libfoo.a found in any of the directories being searched. Dynamic mode is in effect by default unless the -bstatic option is used.

The run time linker mimics the behavior of the ld command when static linking is used, except that only exported symbols can be used to resolve symbols. Even when run time linking is used, the system loader must be able to load and resolve all symbol references in the main program and any module it depends on. Therefore, if a definition is removed from a module, and the main program has a reference to this definition, the program will not execute, even if another definition for the symbol exists in another module.

The run time linker can rebind all references to symbols imported from another module. A reference to a symbol defined in the same module as the reference can only be rebound if the module was built with run time linking enabled for that symbol.

Shared modules shipped with AIX® 4.2 or later have run time linking enabled for most exported variables. run time linking for functions is only enabled for functions called through a function pointer. For example, as shipped, calls to the malloc subroutine within shared object shr.o in /lib/libc.a cannot be rebound, even if a definition of malloc exists in the main program or another shared module. You can link most shipped shared modules to enable run time linking for functions as well as variables by running the rtl_enable command.

Operation of the run time linker

The main program is loaded and resolved by the system loader in the usual way. If the executable program cannot be loaded for any reason, the exec() subroutine fails and the run time linker is not invoked at all. If the main program loads successfully, control passes to the run time linker, which rebinds symbols as described below. When the run time linker completes, initialization routines are called, if appropriate, and then the main function is called.

The run time linker processes modules in breadth-first search order, starting with the main executable and continuing with the direct dependents of the main executable, according to the order of dependent modules listed in each module's loader section. This order is also used when searching for the defining instance of a symbol. The "defining instance" of a symbol is usually the first instance of a symbol, but there are two exceptions. If the first instance of a symbol is an unresolved, deferred import, no defining instance exists. If the first instance is a BSS symbol (that is, with type XTY_CM, indicating an uninitialized variable), and there is another instance of the symbol that is neither a BSS symbol nor an unresolved, deferred import, the first such instance of the symbol is the defining instance.

The loader section of each module lists imported symbols, which are usually defined in another specified module, and exported symbols, which are usually defined in the module itself. A symbol that is imported and exported is called a "passed-through'' import. Such a symbol appears to be defined in one module, although it is actually defined in another module.

Symbols can also be marked as "deferred imports." References to deferred import symbols are never rebound by the run time linker. Resolution of these symbols must be performed by the system loader, either by calling loadbind() or by loading a new module explicitly with load() or dlopen().

References to imported symbols (other than deferred imports) can always be rebound. The system loader will have already resolved most imports. References to each imported symbol are rebound to the symbol's defining instance. If no defining instance exists, an error message will be printed to standard error. In addition, if the typechecking hash string of an imported symbol does not match the hash string of the defining symbol, an error message is printed.

References to exported symbols are also rebound to their defining instances, as long as the references appear in the relocation table of the loader section. (Passed-through imports are processed along with other imports, as described above.) Depending on how the module was linked, some references to exported symbols are bound at link time and cannot be rebound. Since exported symbols are defined in the exporting module, a defining instance of the symbol will always exist, unless the first instance is a deferred import, so errors are unlikely, but still possible, when rebinding exported symbols. As with imports, errors are printed if the typechecking hash strings do not match when a symbol is rebound.

Whenever a symbol is rebound, a dependency is added from the module using the symbol to the module defining the symbol. This dependency prevents modules from being removed from the address space prematurely. This is important when a module loaded by the dlopen subroutine defines a symbol that is still being used when an attempt is made to unload the module with the dlclose subroutine.

The loader section symbol table does not contain any information about the alignment or length of symbols. Thus, no errors are detected when symbols are rebound to instances that are too short or improperly aligned. Execution errors may occur in this case.

Once all modules have been processed, the run time linker calls the exit subroutine if any run time linking errors occurred, passing an exit code of 144 (0x90). Otherwise, execution continues by calling initialization routines ormain().

Creating a shared object with run time linking enabled

To create a shared object enabled for run time linking, you link with the -G flag. When this flag is used, the following actions take place:

  1. Exported symbols are given the nosymbolic attribute, so that all references to the symbols can be rebound by the run time linker.
  2. Undefined symbols are permitted (see the -berok option). Such symbols are marked as being imported from the symbolic module name "..". Symbols imported from ".." must be resolved by the run time linker before they can be used because the system loader will not resolve these symbols.
  3. The output file is given a module type of SRE, as if the -bM:SRE option had been specified.
  4. All shared objects listed on the command line are listed as dependents of the output module, in the same manner as described when linking a program with the -brtl option.
  5. Shared objects in archives are listed if they have the autoload attribute.

Using the -berok option, implied by the -G flag, can mask errors that could be detected at link time. If you intend to define all referenced symbols when linking a module, you should use the -bernotok option after the -G flag. This causes errors to be reported for undefined symbols.

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            亚洲欧美在线x视频| 欧美在线999| 国产日韩亚洲欧美综合| 欧美亚洲第一区| 国产精品一区免费在线观看| 国产九九精品视频| 国产一区二区三区免费观看| 精品9999| 一区二区三区日韩| 久久精品国产亚洲一区二区| 老司机免费视频久久| 亚洲国产激情| 亚洲一区二区免费在线| 久久久久久久久久久成人| 欧美日韩你懂的| 国产综合欧美在线看| 亚洲精品无人区| 欧美专区在线| 亚洲精品1区2区| 欧美一区在线看| 欧美日韩一区二区三区视频| 激情综合激情| 午夜在线不卡| 亚洲美女视频| 免费成人av在线| 国产午夜精品理论片a级大结局 | 免费观看在线综合色| 亚洲国产导航| 久久成人免费| 国产精品vip| 亚洲精品一区在线观看| 久久午夜电影网| 亚洲欧美国产高清va在线播| 欧美激情免费观看| 在线观看日韩国产| 久久国产天堂福利天堂| 亚洲伦理久久| 久久在线免费视频| 国产一区二区三区四区老人| 亚洲一区在线观看视频| 亚洲精品欧美日韩| 欧美激情按摩| 亚洲日韩视频| 欧美第一黄网免费网站| 欧美在线视频一区二区三区| 国产精品亚洲аv天堂网| 在线中文字幕不卡| 亚洲精品乱码久久久久久黑人| 六月婷婷一区| 亚洲国产欧美日韩| 欧美不卡一区| 免播放器亚洲一区| 亚洲第一福利在线观看| 免费观看一级特黄欧美大片| 久久久一二三| 亚洲国产日韩综合一区| 亚洲高清在线观看一区| 欧美成人a∨高清免费观看| 在线日本成人| 亚洲高清在线播放| 欧美日本在线一区| 亚洲视频一区二区在线观看 | 欧美巨乳在线观看| 日韩午夜中文字幕| 亚洲精品乱码久久久久久| 欧美日本中文字幕| 亚洲综合日韩在线| 午夜精品久久| 激情成人av| 亚洲电影视频在线| 欧美精品一区二区三区蜜臀| 一区二区三区四区五区视频| 一本大道久久a久久综合婷婷 | 欧美国产在线观看| 欧美日韩国产丝袜另类| 午夜精品www| 久久不射电影网| 亚洲国产日韩一区二区| 亚洲毛片在线观看| 亚洲免费影院| 欧美一区激情| 欧美在线观看视频一区二区三区 | 尤物网精品视频| 欧美福利一区二区| 欧美日产在线观看| 欧美一区中文字幕| 久久综合九色欧美综合狠狠| 99pao成人国产永久免费视频| 99综合视频| 一区二区亚洲精品| 一区二区三区蜜桃网| 韩国v欧美v日本v亚洲v | 欧美激情亚洲激情| 午夜精品一区二区三区在线 | 亚洲综合不卡| 亚洲精品在线视频| 午夜久久福利| 日韩一二在线观看| 欧美在线|欧美| 一区二区三区|亚洲午夜| 久久成人国产| 亚洲欧美日韩一区二区在线| 蜜桃av一区二区| 久久国产精品一区二区| 欧美伦理视频网站| 欧美www在线| 国产亚洲欧美日韩日本| 99在线热播精品免费| 亚洲激情精品| 久久久免费观看视频| 欧美主播一区二区三区| 欧美日韩亚洲一区三区| 亚洲福利在线观看| 亚洲福利av| 久久精品夜色噜噜亚洲a∨| 午夜亚洲福利在线老司机| 欧美精品久久久久久久久老牛影院| 另类专区欧美制服同性| 国产人成一区二区三区影院| 一区二区三区你懂的| 99国产精品国产精品毛片| 免费成人小视频| 欧美成人免费全部观看天天性色| 国产一区二区高清| 欧美一级电影久久| 久久国产精品亚洲77777| 国产欧美一区二区三区久久| 亚洲无亚洲人成网站77777| 在线视频亚洲| 欧美视频亚洲视频| 一区二区三区福利| 亚洲欧美久久久| 国产精品美女视频网站| 中文欧美字幕免费| 欧美一区二区在线播放| 国产日韩欧美视频| 欧美一区中文字幕| 欧美a级理论片| 亚洲国产欧美一区二区三区丁香婷| 久久亚洲二区| 欧美福利一区二区| 免费成人av在线| 国产精品国产三级国产普通话99 | 亚洲在线播放电影| 久久久精品免费视频| 亚洲天堂激情| 麻豆精品视频| 亚洲国产日韩欧美一区二区三区| 亚洲国产精品一区二区尤物区 | 久久久久久噜噜噜久久久精品| 久久婷婷蜜乳一本欲蜜臀| 一色屋精品视频在线观看网站| 久久另类ts人妖一区二区| 欧美激情第1页| 在线一区二区日韩| 国产日韩在线视频| 久热精品视频在线观看| 亚洲日产国产精品| 欧美在线首页| 亚洲国产成人久久综合| 欧美日韩国产在线一区| 欧美一区二区日韩一区二区| 欧美国产大片| 午夜久久福利| 亚洲欧洲午夜| 欧美性色aⅴ视频一区日韩精品| 午夜国产精品视频| 欧美激情一区二区三区| 亚洲欧美在线x视频| 亚洲电影第1页| 国产精品免费一区豆花| 免费成人黄色片| 欧美一区二区在线播放| 性欧美1819性猛交| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ入口 | 久久久久青草大香线综合精品| 性色一区二区三区| 亚洲一区在线播放| 国内精品美女av在线播放| 亚洲专区一区| 久久精品欧洲| 日韩视频在线观看| 亚洲伊人伊色伊影伊综合网 | 久久久国产精品亚洲一区| 久久疯狂做爰流白浆xx| 一本久道综合久久精品| 午夜精品理论片| 国产精品美女在线| 久久综合色天天久久综合图片| 亚洲一区二区在| 欧美日韩国产一区二区三区| 欧美在线视频观看| 欧美二区在线播放| 欧美成人午夜剧场免费观看| 欧美日韩在线免费观看| 日韩天天综合| 在线观看日韩www视频免费 | 欧美日韩中文精品| 蜜臀久久99精品久久久久久9| 性欧美1819性猛交|