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

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>
            美女精品在线| 日韩亚洲在线观看| 亚洲免费在线电影| 国产精品h在线观看| 免费欧美高清视频| 亚洲欧美制服中文字幕| 亚洲激情视频在线| 亚洲精品一区二区三区99| 好看的日韩视频| 亚洲高清资源| 91久久精品国产| 亚洲精品在线三区| aa亚洲婷婷| 亚洲欧美国产毛片在线| 久久久久久久精| 欧美激情亚洲激情| 亚洲美女av电影| 一区二区不卡在线视频 午夜欧美不卡在| 欧美精品一区二区三区蜜臀| 女主播福利一区| 国产精品乱码妇女bbbb| 狠狠色丁香婷婷综合久久片| 亚洲欧洲中文日韩久久av乱码| 最近看过的日韩成人| 亚洲午夜日本在线观看| 久久综合精品国产一区二区三区| 久久色在线观看| 亚洲欧美高清| 欧美日韩一区二区三区| 伊人精品视频| 午夜精品成人在线| 欧美激情国产日韩| 久久er99精品| 国产精品九色蝌蚪自拍| 亚洲黄色成人久久久| 亚洲男人av电影| 99国产精品视频免费观看一公开| 香蕉成人久久| 国产精品视频一二三| 一区二区三区四区五区精品视频 | 欧美综合77777色婷婷| 欧美成人午夜激情在线| 欧美一区二区三区播放老司机| 一区二区三区av| 亚洲欧美视频一区| 亚洲激情视频网站| 久久久噜噜噜久久中文字免| 国产精品视频男人的天堂| 亚洲欧美日韩另类| 在线一区观看| 国产日韩欧美电影在线观看| 一区二区在线视频| 一区二区三区视频在线观看 | 一区二区三区高清| 欧美~级网站不卡| 亚洲女人天堂成人av在线| 欧美日韩免费观看中文| 亚洲区国产区| 欧美激情视频免费观看| 久久精品免费观看| 国产一区二区三区久久久久久久久| 99视频精品| 亚洲精品黄网在线观看| 欧美成人在线免费观看| 亚洲精品之草原avav久久| 亚洲电影天堂av| 欧美a级大片| 99国产精品久久久久久久久久 | 欧美日韩福利| 亚洲人成7777| 欧美日韩国产综合一区二区| 日韩视频中午一区| 99在线热播精品免费99热| 欧美日韩在线视频首页| 亚洲系列中文字幕| 亚洲午夜久久久久久尤物| 国产精品成人播放| 午夜欧美大片免费观看| 午夜欧美大片免费观看| 在线国产精品一区| 亚洲国产婷婷综合在线精品 | 久久av免费一区| 精品成人a区在线观看| 欧美成人首页| 欧美日韩免费高清| 欧美中文字幕久久| 久久久免费观看视频| 99av国产精品欲麻豆| 亚洲乱码国产乱码精品精可以看| 欧美性片在线观看| 老鸭窝亚洲一区二区三区| 久久影院午夜片一区| 亚洲在线观看免费| 久久最新视频| 欧美专区第一页| 欧美国产激情二区三区| 午夜在线成人av| 欧美成人久久| 久久av二区| 欧美日韩一级片在线观看| 久久亚洲欧美| 欧美日韩一区国产| 欧美高清视频一区二区三区在线观看 | 欧美精品福利| 欧美主播一区二区三区| 裸体歌舞表演一区二区| 午夜精品久久久久久久99樱桃| 玖玖国产精品视频| 久久精品123| 欧美承认网站| 久久精品综合| 国产麻豆9l精品三级站| 欧美激情一二三区| 国产在线国偷精品产拍免费yy| 亚洲欧洲在线看| 黄网站色欧美视频| 亚洲自拍另类| 亚洲欧美激情在线视频| 欧美成人一品| 欧美顶级少妇做爰| 国产日韩欧美视频在线| 一本久道综合久久精品| 亚洲精品国产精品国产自| 久久精品一级爱片| 久久久久国产精品人| 国产精品美女久久久浪潮软件| 亚洲国产精品精华液2区45| 国产美女精品一区二区三区| 一本一本a久久| 亚洲视频1区2区| 欧美精品免费在线| 91久久黄色| 亚洲日韩欧美视频一区| 久久综合99re88久久爱| 免费亚洲电影在线观看| 国产一区二区主播在线| 亚洲欧美日韩国产中文在线| 亚洲一区日韩| 国产精品一区二区三区免费观看| 正在播放欧美一区| 午夜激情综合网| 国产精品―色哟哟| 亚洲中字在线| 久久精品电影| 悠悠资源网久久精品| 久久久精品日韩| 欧美成人午夜77777| 亚洲激情网站| 欧美性猛片xxxx免费看久爱| 亚洲一级影院| 久久免费99精品久久久久久| 久久综合电影一区| 最新精品在线| 欧美天天影院| 欧美一区二区三区久久精品茉莉花 | 国产精品私拍pans大尺度在线| 亚洲女人小视频在线观看| 亚洲一区二区精品视频| 亚洲精品一区二区三区四区高清 | 欧美激情一区二区三区在线视频观看| 亚洲黄网站黄| 欧美日韩国产精品成人| 亚洲一区二区三区精品在线| 欧美日韩在线一区| 亚洲欧美一区二区激情| 国产精品久久久久99| 午夜精品国产更新| 欧美华人在线视频| 99精品免费| 国产一区二区三区在线观看网站| 久久人人爽人人爽爽久久| 亚洲三级免费| 久久激情中文| 亚洲免费av片| 国产亚洲免费的视频看| 欧美 日韩 国产一区二区在线视频| 99精品欧美一区二区三区综合在线| 久久久久成人精品| 99精品视频一区二区三区| 国产精品久久久一区麻豆最新章节 | 久久激情婷婷| 99精品国产热久久91蜜凸| 国产日韩精品在线| 欧美精品97| 欧美一区二区三区免费视频| 亚洲电影免费在线| 久久久久久久综合狠狠综合| 99re在线精品| 亚洲黄页一区| 国产在线不卡视频| 欧美日韩精品伦理作品在线免费观看| 久久国产精品久久w女人spa| 99这里只有久久精品视频| 免费观看成人www动漫视频| 亚洲制服丝袜在线| 亚洲免费播放| 亚洲高清在线观看| 在线观看日韩一区| 国产真实久久| 国产午夜精品理论片a级大结局 |