kernel に制御がわたる 2. Linux kernel が execve(2) を実⾏ ◦ Linux kernel とは OS のコア部分 ◦ ld-linux.so に制御がわたる 3. ld-linux.so が main を起動 ◦ ld-linux.so とはプログラムをメモリ上に展開するプログラム ◦ main と依存する共有ライブラリをメモリ上に展開 ◦ リロケーション ◦ main に制御がわたる Linux におけるプログラムの起動の流れ
メタ情報には MN-Core 機械語 ファイルのどの位置が PyTorch のどの変数に対応するかの情報 が含まれている ◦ R_X86_64_64 と意味は同じ リロケーション reloc: group name: [email protected] group addr: 10000032 group size: 16 value name:[email protected] value addr:10000032 value size:16 value bin_indices: [0, ] value packed_instruction_indices: [15, ] value addresses_in_group: [0, ] group name: [email protected] group addr: 10000016 group size: 16 value name:[email protected] value addr:10000016 value size:16 value bin_indices: [0, ] value packed_instruction_indices: [14, ] value addresses_in_group: [0, ]
limitation was that no relocations are performed at the time of loading and afterward. The shared libraries have to exist in the form they are used at run-time on disk. This imposes a major restriction on the way shared libraries are built and used: every shared library must have a fixed load address; otherwise it would not be possible to generate shared libraries which do not have to be relocated. • 全ての共有ライブラリのアドレスを事前に決定する必要がある ◦ find / | grep “^.*.so$” して⾒つかる⼤量の共有ライブラリ 全てのアドレスを管理する必要があり、事実上不可能 [1]: How To Write Shared Libraries by Ulrich Drepper そもそもリロケーションは必要なのか? (Linux 編)