RPATH: Difference between revisions
(Add categories: Linux, Reference) |
(Template migration to LLM-Optimized Wiki Template) |
||
| Line 1: | Line 1: | ||
{{Status | |||
|status=Draft | |||
|owner=Knowledge Agent | |||
|last_update=2026-07-16 | |||
|review=Pending | |||
}} | |||
{{TOC}} | |||
== Overview == | |||
RPATH에 대한 기술 문서입니다. | |||
=== Summary === | |||
* 무엇인가? - RPATH | |||
* 왜 필요한가? - HPC 및 서버 환경에서 필수 개념 | |||
* 언제 사용하는가? - 서버 구성, 성능 튜닝, 문제 해결 시 | |||
--- | |||
== Purpose == | |||
이 문서가 존재하는 이유 | |||
* Goal: RPATH에 대한 기술 정보 제공 | |||
* Scope: RPATH의 개념, 사용법, 설정 | |||
* Non-goals: 다른 주제로의 확장 | |||
--- | |||
== Key Concepts == | |||
{| class="wikitable" | |||
! Concept | |||
! Description | |||
! Related | |||
|- | |||
| RPATH | |||
| HPC/서버 환경에서 중요한 기술 개념 | |||
| [[Linux]], [[Server]] | |||
|} | |||
--- | |||
== Detailed Explanation == | |||
'''rpath''' designates the run-time search path hard-coded in an executable file or [[library]]. Dynamic linking loaders use the rpath to find required libraries. <ref>https://en.wikipedia.org/wiki/Rpath</ref> | |||
When you are '''compiling''' a program, you create object files and then '''link''' them together. You may use GNU ld(1) to link them, there are also other linkers, LLVM linker. A linker combines object files into executable. After then when you '''execute''' an already compiled ready to use executable then the dynamic linker ld.so(8) finds the libraries on the system that the executable depends on, loads them and executes the executable. ld.so(8) is a shared library usually distributed as part of C standard library, usually on [[linux]] that's glibc, but there are also other, like musl. | |||
The <code>-rpath</code> command line option in compile stage, used to create a <code>DT_RPATH</code> entry in the <code>.dynamic</code> section, but since <code>DT_RPATH</code> was deprecated in favor of <code>DT_RUNPATH</code>, modern linker versions use <code>DT_RUNPATH</code> instead. This means that using <code>-rpath</code> on a really old linker, you will create a dynamic section entry with <code>.d_val = DT_RPATH</code>, but if your linker is up to date, you will create one with <code>.d_val = DT_RUNPATH</code> instead. | The <code>-rpath</code> command line option in compile stage, used to create a <code>DT_RPATH</code> entry in the <code>.dynamic</code> section, but since <code>DT_RPATH</code> was deprecated in favor of <code>DT_RUNPATH</code>, modern linker versions use <code>DT_RUNPATH</code> instead. This means that using <code>-rpath</code> on a really old linker, you will create a dynamic section entry with <code>.d_val = DT_RPATH</code>, but if your linker is up to date, you will create one with <code>.d_val = DT_RUNPATH</code> instead. | ||
The <code>-rpath-link</code> option is an option which ''does not'' create any entry, but is used to supersede the <code>DT_RUNPATH</code> entry present in the dynamic section of a library that is being linked. Therefore, when compiling, you should usually not need it.<ref>https://stackoverflow.com/questions/67131565/how-do-i-set-dt-rpath-or-dt-runpath</ref> | |||
Administrator can modify the dynamic linker and RPATH of ELF executables using [[PatchELF]] | |||
<references /> | |||
--- | |||
== Best Practices == | |||
* 최신 버전 사용 권장 | |||
* 공식 문서 참고 | |||
* 테스트 환경에서 먼저 검증 | |||
--- | |||
== References == | == References == | ||
* [https://wiki.hpcmate.com RPATH] | |||
--- | |||
== Related Pages == | |||
* [[Linux]] | |||
* [[Server]] | |||
* [[Hardware]] | |||
* [[Network]] | |||
--- | |||
[[Category:Server]] | |||
[[Category:Reference]] | [[Category:Reference]] | ||
Revision as of 15:25, 16 July 2026
Overview
RPATH에 대한 기술 문서입니다.
Summary
- 무엇인가? - RPATH
- 왜 필요한가? - HPC 및 서버 환경에서 필수 개념
- 언제 사용하는가? - 서버 구성, 성능 튜닝, 문제 해결 시
---
Purpose
이 문서가 존재하는 이유
- Goal: RPATH에 대한 기술 정보 제공
- Scope: RPATH의 개념, 사용법, 설정
- Non-goals: 다른 주제로의 확장
---
Key Concepts
| Concept | Description | Related |
|---|---|---|
| RPATH | HPC/서버 환경에서 중요한 기술 개념 | Linux, Server |
---
Detailed Explanation
rpath designates the run-time search path hard-coded in an executable file or library. Dynamic linking loaders use the rpath to find required libraries. [1]
When you are compiling a program, you create object files and then link them together. You may use GNU ld(1) to link them, there are also other linkers, LLVM linker. A linker combines object files into executable. After then when you execute an already compiled ready to use executable then the dynamic linker ld.so(8) finds the libraries on the system that the executable depends on, loads them and executes the executable. ld.so(8) is a shared library usually distributed as part of C standard library, usually on linux that's glibc, but there are also other, like musl.
The -rpath command line option in compile stage, used to create a DT_RPATH entry in the .dynamic section, but since DT_RPATH was deprecated in favor of DT_RUNPATH, modern linker versions use DT_RUNPATH instead. This means that using -rpath on a really old linker, you will create a dynamic section entry with .d_val = DT_RPATH, but if your linker is up to date, you will create one with .d_val = DT_RUNPATH instead.
The -rpath-link option is an option which does not create any entry, but is used to supersede the DT_RUNPATH entry present in the dynamic section of a library that is being linked. Therefore, when compiling, you should usually not need it.[2]
Administrator can modify the dynamic linker and RPATH of ELF executables using PatchELF
---
Best Practices
- 최신 버전 사용 권장
- 공식 문서 참고
- 테스트 환경에서 먼저 검증
---
References
---
Related Pages
---