]>
git.saurik.com Git - apple/security.git/blob - symbol_strip.sh
5 echo "Export file name required."
9 expbase
=`basename $expfile`
11 echo ====== BUILT_PRODUCTS_DIR
${BUILT_PRODUCTS_DIR} ======
12 echo ====== INNER_PRODUCT_SUBPATH
${INNER_PRODUCT_SUBPATH} ======
14 # Don't rerun this unless the file has been relinked
15 if [ "${BUILT_PRODUCTS_DIR}/${expbase}.timestamp" -nt "${BUILT_PRODUCTS_DIR}/${INNER_PRODUCT_SUBPATH}" ]; then
16 echo "${BUILT_PRODUCTS_DIR}/${INNER_PRODUCT_SUBPATH} is up to date."
20 # Under pbbuild, install target builds the target binary directly in DSTROOT, not
21 # in BUILT_PRODUCTS_DIR. Normal development build results in building the
22 # binary in SYMROOT, which is the same as BUILT_PRODUCTS_DIR.
24 if [ -e ${BUILT_PRODUCTS_DIR}/${INNER_PRODUCT_SUBPATH} ]
26 binary_file
=${BUILT_PRODUCTS_DIR}/${INNER_PRODUCT_SUBPATH}
27 elif [ -e ${DSTROOT}/${INSTALL_PATH}/${INNER_PRODUCT_SUBPATH} ]
29 binary_file
=${DSTROOT}/${INSTALL_PATH}/${INNER_PRODUCT_SUBPATH}
31 echo ==== Can not
find linked Security binary
====
34 echo "Scanning $binary_file"
35 ARCHS
=`lipo -info "$binary_file" | awk -F : '{print $3}'`
38 echo "Generating exports file ${BUILT_PRODUCTS_DIR}/${expbase}_$arch"
39 nm
-gp -arch $arch "$binary_file" \
40 | egrep -v '^/| U _' \
42 | egrep '_(|tf|ti|C)(|Q[2-9])8Security|_(N|ZN|ZNK|ZTTN|ZTVN)8Security|_ZN9KeySchema|^_(Sec|CSSM|Authorization)' \
44 | sort -u > "${BUILT_PRODUCTS_DIR}/${expbase}_$arch"
45 echo nmedit
-s "${BUILT_PRODUCTS_DIR}/${expbase}_$arch" -arch $arch "$binary_file"
46 nmedit
-s "${BUILT_PRODUCTS_DIR}/${expbase}_$arch" -arch $arch "$binary_file"
48 touch "${BUILT_PRODUCTS_DIR}/${expbase}.timestamp"