第4章アルゴリズムの言語による実現:低水準プログラミング言語
Tools to Manipulate Object Filesオブジェクトファイルを操作するツール
An object file contains a lot of information such as metadata, machine code, and other information from symbols. To manipulate such files, Unix provides certain tools to use them effectively, such as:
オブジェクトファイルには、メタデータ、機械語コード、シンボルに由来するその他の情報など、多くの情報が含まれる。このようなファイルを効果的に操作するため、Unixは次のようなツールを備える。
• ar: Creates static libraries, and inserts, deletes, lists and extracts members.
• ar:静的ライブラリーを作成し、メンバーを挿入、削除、一覧表示、抽出する。
• strings: Lists all the printable strings contained in an object file.
英語のヒント
• strings:オブジェクトファイルに含まれる、印字可能な文字列をすべて一覧表示する。
• strip: Deletes symbol information from an object file.
• strip:オブジェクトファイルからシンボル情報を削除する。
• nm: Lists the symbols defined in the symbol table od an object file.
• nm:オブジェクトファイルのシンボル表に定義されたシンボルを一覧表示する。
• size: Lists the names and sizes of the sections in an object file.
• size:オブジェクトファイル内のセクションの名前と大きさを一覧表示する。
• readelf: Displays the complete structure of an object file, including all of the information encoded in the ELF header; subsumes the functionality of “size” and “nm.”
英語のヒント
• readelf:ELFヘッダーに符号化されたすべての情報を含め、オブジェクトファイルの構造全体を表示する。「size」と「nm」の機能を包含する。
• objdump: Displays all of the information in an object file; useful for disassembling binary instructions in the .text section.
英語のヒント
• objdump:オブジェクトファイル内のすべての情報を表示する。.textセクションのバイナリー命令を逆アセンブルするのに便利である。
• ldd (linux): Lists the shared libraries that an executable needs at runtime.
• ldd(linux):実行可能ファイルが実行時に必要とする共有ライブラリーを一覧表示する。
Version Control Managementバージョン管理
The process and tools used to store and improve multiple versions of project files is called version control. Version control also helps support team collaboration, and allows for the ability to revert to an earlier versions. Git is a widely-used version control system. Creating and updating project files using Git requires the creation of a Git repository, also known as “repo” for short. A repository is a container for files and related information stored in a version control tool. GitHub is a website that allows free storage of public git repositories.
英語のヒント
プロジェクトのファイルの複数の版を保存し、改善するために使う過程とツールを、バージョン管理という。バージョン管理はチームの共同作業も支え、以前の版に戻せるようにする。Gitは、広く使われるバージョン管理システムである。Gitを使ってプロジェクトのファイルを作成・更新するには、Gitリポジトリー、略してrepoを作る必要がある。リポジトリーとは、バージョン管理ツールに保存されたファイルと関連情報を入れる場所である。GitHubは、公開Gitリポジトリーを無料で保存できるWebサイトである。
LINK TO LEARNING学習リンク
Learn more by installing Git on your local machine (https://openstax.org/r/76InstallGit) on any platform. You may run “
brew install git” on MacOS to install Git or “sudo apt install git” on Linux.どのプラットフォームでも、自分のマシンにGitをインストールする(https://openstax.org/r/76InstallGit)ことで、さらに学ぼう。macOSでは「brew install git」、Linuxでは「sudo apt install git」を実行してGitをインストールできる。
Useful Git commands are as follows:
便利なGitコマンドを次に示す。
•
git config --global user.email "you@example.com" and git config --global user.name "Your Name"• git config --global user.email "you@example.com"とgit config --global user.name "Your Name"
• Clone: to download contents
• Clone:内容をダウンロードする。
• Pull:
git pull origin master to pull latest changes• Pull:git pull origin masterで、最新の変更を取得する。
• Status:
git status to see staged (shown in green) and un-staged (shown in red) files• Status:git statusで、ステージ済み(緑色)と未ステージ(赤色)のファイルを確認する。
• Staging:
git add <filename’ to add files to staged area (wildcards accepted)• Staging:git add <filename’で、ファイルをステージ領域へ追加する。ワイルドカードも使える。
• Commit:
git commit –m "<your message here>" to commit the staged files• Commit:git commit –m "<your message here>"で、ステージ済みのファイルをコミットする。
• Push:
git push origin master to push all changes made locally to the origin• Push:git push origin masterで、ローカルで行ったすべての変更をoriginへ送る。
LINK TO LEARNING学習リンク
Explore the Git/GitHub tutorial (https://openstax.org/r/76GitHubTutor) for more details on how to use Git.
Gitの使い方をさらに詳しく知るには、Git/GitHubのチュートリアル(https://openstax.org/r/76GitHubTutor)を見てみよう。