Initial import from FreeBSD RELENG_4:
[dragonfly.git] / contrib / binutils / ld / emulparams / elf64_sparc.sh
1 SCRIPT_NAME=elf
2 ELFSIZE=64
3 TEMPLATE_NAME=elf32
4 OUTPUT_FORMAT="elf64-sparc"
5 MAXPAGESIZE=0x100000
6 ARCH="sparc:v9"
7 MACHINE=
8 DATA_PLT=
9 GENERATE_SHLIB_SCRIPT=yes
10 NOP=0x01000000
11 NO_SMALL_DATA=yes
12
13 case "$target" in
14   sparc*-solaris*)
15     TEXT_START_ADDR=0x100000000
16     NONPAGED_TEXT_START_ADDR=0x100000000
17     ;;
18   *)
19     TEXT_START_ADDR=0x100000
20     NONPAGED_TEXT_START_ADDR=0x100000
21     ;;
22 esac
23
24 if [ "x${host}" = "x${target}" ]; then
25   case " $EMULATION_LIBPATH " in
26     *" ${EMULATION_NAME} "*)
27       # Native, and default or emulation requesting LIB_PATH.
28
29       # Linux and Solaris modify the default library search path
30       # to first include a 64-bit specific directory.  It's put
31       # in slightly different places on the two systems.
32       case "$target" in
33         sparc*-linux*)
34           suffix=64 ;;
35         sparc*-solaris*)
36           suffix=/sparcv9 ;;
37       esac
38
39       if [ -n "${suffix}" ]; then
40
41         LIB_PATH=/lib${suffix}:/lib
42         LIB_PATH=${LIB_PATH}:/usr/lib${suffix}:/usr/lib
43         if [ -n "${NATIVE_LIB_DIRS}" ]; then
44           LIB_PATH=${LIB_PATH}:`echo ${NATIVE_LIB_DIRS} | sed s_:_${suffix}:_g`${suffix}:${NATIVE_LIB_DIRS}
45         fi
46         if [ "${libdir}" != /usr/lib ]; then
47           LIB_PATH=${LIB_PATH}:${libdir}${suffix}:${libdir}
48         fi
49         if [ "${libdir}" != /usr/local/lib ]; then
50           LIB_PATH=${LIB_PATH}:/usr/local/lib${suffix}:/usr/local/lib
51         fi
52
53       fi
54     ;;
55   esac
56 fi