1 # This shell script does the work of generating the ld-emulation-target
2 # specific information from a specific file of paramaters.
3 # Usage: genscripts.sh srcdir host_alias target_alias emulation_name
9 # Include the emulation-specic parameters:
12 # Set the library search path (for libraries named by -lfoo).
13 # If LIB_PATH is defined (and non-empty), it is used.
14 # (The format is the usual list of colon-separated directories.)
15 # (To force a logically empty LIB_PATH, do LIBPATH=":".)
16 # Otherwise, the default is /lib:/usr/lib:/usr/local/lib,
17 # unless cross-compiling, in which case the default remains empty.
19 if [ "x${LIB_PATH}" = "x" -a "x${host_alias}" = "x${target_alias}" ] ; then
20 LIB_PATH
=/lib
:/usr
/lib
:/usr
/local
/lib
22 LIB_SEARCH_DIRS
=`echo ${LIB_PATH} | tr ':' ' ' | sed -e 's/\([^ ][^ ]*\)/SEARCH_DIR(\1);/g'`
24 # This script generates 5 script files from the master script template
25 # in ${srcdir}/${SCRIPT_NAME}.sh. Which one of the 5 script files
26 # is actually used depends on command line flags given to ld.
27 # The actual script is filtered through the mkscript program
28 # to convert it to a form suitable for including in a C program
29 # as a C string literal.
31 # A .x script file is the default script.
32 # A .xr script is for linking without relocation (-r flag).
33 # A .xu script is like .xr, but *do* create constructors (-Ur flag).
34 # A .xn script is for linking with -n flag (mix text and data on same page).
35 # A .xN script is for linking with -N flag (mix text and data on same page).
37 THIS_TEXT_START_ADDR
=${TEXT_START_ADDR}
38 SEGMENT_SIZE
=${SEGMENT_SIZE-${PAGE_SIZE}}
40 DATA_ALIGNMENT
="ALIGN(${SEGMENT_SIZE})"
42 (.
${srcdir}/${SCRIPT_NAME}.sc-sh
) |
sed -e '/^ *$/d' | .
/mkscript \
45 (.
${srcdir}/${SCRIPT_NAME}.sc-sh
) |
sed -e '/^ *$/d' | .
/mkscript \
48 (.
${srcdir}/${SCRIPT_NAME}.sc-sh
) |
sed -e '/^ *$/d' | .
/mkscript \
50 THIS_TEXT_START_ADDR
=${NONPAGED_TEXT_START_ADDR-${TEXT_START_ADDR}}
51 (.
${srcdir}/${SCRIPT_NAME}.sc-sh
) |
sed -e '/^ *$/d' | .
/mkscript \
54 (.
${srcdir}/${SCRIPT_NAME}.sc-sh
) |
sed -e '/^ *$/d' | .
/mkscript \
57 #sed -e s/"<ldtarget>"/${EMULATION_NAME}/g -e s/"<arch>"/${ARCH}/g \
58 # -e s/"<target>"/${EMULATION_NAME}/g -e s/"<target_name>"/${OUTPUT_FORMAT}/g \
59 # <${srcdir}/${TEMPLATE_NAME-ldtemplate} >ld__${EMULATION_NAME}.c
61 .
${srcdir}/${TEMPLATE_NAME-generic}.em
This page took 0.030466 seconds and 4 git commands to generate.