IT한 것/unix

HP-UX Dynamic Path Search Behavior

lovian 2009. 2. 2. 14:56
64-bit Mode Run Time Differences

64비트 모드로 컴파일되고 링크된 프로그램은 다른 SVR4 시스템과 유사한 실행시간 동적 적재모델을 사용한다. 64비트 모드에서 프로그램 시작시 ㅂㄴㅕ경되는 두개의 중요한 영역이 있다.

Applications compiled and linked in 64-bit mode use a run-time dynamic
loading model similar to other SVR4 systems. There are two main areas
where program startup changes in 64-bit mode:

. 공유된 라이브러리용 동적 경로 탐색
. 독립된 라이브러리의 기호 탐색

• Dynamic path searching for shared libraries.
• Symbol searching in dependent libraries.

64비트 프로그램을 링킹할때에 기본적으로 적용되는, 표준 SVR4 링킹 옵션(+std)을 이용할 것을 추천한다. 사용자가 32비트와 호환되는 링킹 과정을 원하면 주변환경을 변경시킬 수도 있다. 64비트 링커는 32비트 링킹과 동적 적재 과정을 이용할 수 있도록 강제하는 +compat옵션을 제공한다.
아래의 테이블은 32비트 모드와 64비트 모드의 동적에서 적재에 대한 차이점을 요약한다.

It is recommended that you use the standard SVR4 linking option
(+std), which is on by default when linking 64-bit applications. There
may be circumstances while you transition, that you need 32-bit
compatible linking behavior. The 64-bit linker provides the +compat
option to force the linker to use 32-bit linking and dynamic loading
behavior.
The following table summarizes the dynamic loader differences between 32-bit and 64-bit mode

  • +s, +b path_list 순서
    • 32-bit : 두 옵션의 순서는 중요하다.
    • 64-bit : 기본적으로 순서는 중요하지 않다. +compat 옵션을 쓰면 순서가 중요하도록 강제 할 수 있다.
  • 의존 라이브러리의 기호(심볼) 탐색
    • 32-bit : DFS로 탐색한다. (차근차근 depth를 내려가면 탐색하는 방법.)
    • 64-bit : BFS로 탐색한다. (이웃하는 노드'sibling' 를 우선으로 탐색하는 방법.) +compat을 쓰면 DFS로 작동한다.
  • 실행시간경로 환경변수
    • 32-bit : 기본적으로 실행시간경로 환경변수 사용이 불가능. +s가 주어지면 SHLIB_PATH가 사용가능하다.
    • 64-bit : LD_LIBRARY_PATH와 SHLIB_PATH가 사용가능하다. +noenv 또는 +compat을 주면 사용 불가능하게 할 수있다.
  • +b path_list와 -L directories 의 상호작용.
    • 32-bit : -L 은 실행가능한 절대 경로를 기록한다.
    • 64-bit : -L 은 실행가능한 경로를 기록하지 않는다. -L에 명시한 모든 디렉토리를 +b path_list에 추가한다.

For more information on transition issues, see HP-UX 64-bit Porting and
Transition Guide.