summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDenis Vlasenko2007-08-14 16:43:01 +0000
committerDenis Vlasenko2007-08-14 16:43:01 +0000
commitdbe6e66d6a8addbbf9438f40a645be8ae105fa8a (patch)
treea745eb3196d4c031568256345790d85bc29edc63 /scripts
parenta1120a8ea29d4a825cbbb796fa15d77b15ca401f (diff)
downloadbusybox-dbe6e66d6a8addbbf9438f40a645be8ae105fa8a.zip
busybox-dbe6e66d6a8addbbf9438f40a645be8ae105fa8a.tar.gz
trylink: automatically use custom link script if user provides one
vinfo_msg: one user (info_msg), incorporate in it *: style fixes
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/trylink22
1 files changed, 12 insertions, 10 deletions
diff --git a/scripts/trylink b/scripts/trylink
index 9b67deb..5e96230 100755
--- a/scripts/trylink
+++ b/scripts/trylink
@@ -64,16 +64,18 @@ done
echo "Final link with: $BBOX_LIB_LIST"
l_list=`echo "$BBOX_LIB_LIST" | sed -e 's/ / -l/g' -e 's/^/-l/'`
# --verbose gives us gobs of info to stdout (e.g. linker script used)
- try "-Wl,--start-group $l_list -Wl,--end-group -Wl,--verbose" "$@" >busybox_ld.out ####|| exit 1
- #
- # Add SORT_BY_ALIGNMENT to linker script (found in busybox_ld.out):
- # .rodata : { *(.rodata SORT_BY_ALIGNMENT(.rodata.*) .gnu.linkonce.r.*) }
- # *(.data SORT_BY_ALIGNMENT(.data.*) .gnu.linkonce.d.*)
- # *(.bss SORT_BY_ALIGNMENT(.bss.*) .gnu.linkonce.b.*)
- # This will eliminate most of the data padding. Use linker script
- # by commenting "try" above and uncommenting this one (tested on i386):
- #try "-Wl,--start-group $l_list -Wl,--end-group -Wl,--verbose -Wl,-T -Wl,busybox_ldscript" "$@" >busybox_ld.out
- #
+ if ! test -f busybox_ldscript; then
+ try "-Wl,--start-group $l_list -Wl,--end-group -Wl,--verbose" "$@" >busybox_ld.out ####|| exit 1
+ else
+ echo "Custom linker script 'busybox_ldscript' found, using it"
+ # Add SORT_BY_ALIGNMENT to linker script (found in busybox_ld.out):
+ # .rodata : { *(.rodata SORT_BY_ALIGNMENT(.rodata.*) .gnu.linkonce.r.*) }
+ # *(.data SORT_BY_ALIGNMENT(.data.*) .gnu.linkonce.d.*)
+ # *(.bss SORT_BY_ALIGNMENT(.bss.*) .gnu.linkonce.b.*)
+ # This will eliminate most of the data padding. Use linker script
+ # by commenting "try" above and uncommenting this one (tested on i386):
+ try "-Wl,--start-group $l_list -Wl,--end-group -Wl,--verbose -Wl,-T -Wl,busybox_ldscript" "$@" >busybox_ld.out
+ fi
####}
####rm busybox_ld.err
####exit 0 # Ensure "success" exit code