annotate extra/ld @ 416:b4d0eafc5bfe

Fix code generation error in gcc6809 It turned out that under some circumstances, the gcc optimizer would select an instruction sequence that had the sense of a branch inverted. It seems this was due to a particular instruction pattern included in the machine description not being quite right with respect to how the condition codes were tracked. Removing that instruction pattern seems to fix things (subtraction with the arguments reversed). gcc seems to be smart enough to figure out how to reorganize code to work without this reversed sense subtraction and then do the right thing.
author William Astle <lost@l-w.ca>
date Thu, 24 Mar 2016 20:07:20 -0600
parents 26d2791672b1
children a3711f5ac569
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
72
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
1 #!/bin/sh
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
2 #
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
3 #
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
4 # Copyright 2009 by William Astle <lost@l-w.ca>
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
5 #
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
6 #This file is part of LWTOOLS.
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
7 #
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
8 #LWTOOLS is free software: you can redistribute it and/or modify it under the
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
9 #terms of the GNU General Public License as published by the Free Software
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
10 #Foundation, either version 3 of the License, or (at your option) any later
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
11 #version.
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
12 #
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
13 #This program is distributed in the hope that it will be useful, but WITHOUT
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
14 #ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
15 #FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
16 #more details.
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
17 #
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
18 #You should have received a copy of the GNU General Public License along with
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
19 #this program. If not, see <http://www.gnu.org/licenses/>.
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
20
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
21 # this was based somewhat on the "as" script from gcc6809
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
22
79
17d82b46f4c9 Removed excess verbosity from the 'ld' wrapper script
lost@l-w.ca
parents: 72
diff changeset
23 #echo "LWTOOLS-ld $0 $*"
72
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
24 path_to_lwlink=lwlink
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
25
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
26 # Set defaults. Some are based on the target type, which is
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
27 # determined by the name by which the program was invoked.
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
28 output_file=a.out
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
29 libpaths=
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
30 libs=
179
606123758641 Added --sysroot support to lwlink and the ld wrapper script
lost@l-w.ca
parents: 79
diff changeset
31 stdlibpaths="-L=/usr/local/lib -L=/usr/lib -L=/lib"
72
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
32 verbose=
179
606123758641 Added --sysroot support to lwlink and the ld wrapper script
lost@l-w.ca
parents: 79
diff changeset
33
606123758641 Added --sysroot support to lwlink and the ld wrapper script
lost@l-w.ca
parents: 79
diff changeset
34 if [ "$verbose" = 1 ]; then
606123758641 Added --sysroot support to lwlink and the ld wrapper script
lost@l-w.ca
parents: 79
diff changeset
35 echo "$0 $@"
606123758641 Added --sysroot support to lwlink and the ld wrapper script
lost@l-w.ca
parents: 79
diff changeset
36 fi
606123758641 Added --sysroot support to lwlink and the ld wrapper script
lost@l-w.ca
parents: 79
diff changeset
37
72
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
38 case $0 in
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
39 *m6809-coco-*)
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
40 options="--format=decb"
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
41 # options="-b .text=0x2000 -b .data=0x7000 -b .bss=0x7C00 -b .ctors=0x7F00 -b .dtors=0x7F80 -b vector=0x7FF0"
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
42 # aslink_options="-nwxst"
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
43 # exe_suffix=.bin
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
44 ;;
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
45 *)
395
26d2791672b1 Update the "ld" wrapper
William Astle <lost@l-w.ca>
parents: 197
diff changeset
46 options="--format=raw"
72
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
47 # options="-b .text=0x8000 -b .data=0x1000 -b .bss=0x0100 -b .ctors=0xFD00 -b .dtors=0xFE00 -b vector=0xFFF0"
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
48 # aslink_options="-nwxso"
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
49 # exe_suffix=.s19
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
50 ;;
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
51 esac
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
52
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
53
184
6433cb024174 Make ld wrapper more capable
lost@l-w.ca
parents: 179
diff changeset
54 while [ "$*" != "" ]; do
72
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
55 arg=$1; shift
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
56 case $arg in
184
6433cb024174 Make ld wrapper more capable
lost@l-w.ca
parents: 179
diff changeset
57 -d|-dc|-dp)
6433cb024174 Make ld wrapper more capable
lost@l-w.ca
parents: 179
diff changeset
58 # force allocation of space to common symbols
6433cb024174 Make ld wrapper more capable
lost@l-w.ca
parents: 179
diff changeset
59 # even if relocatable output file is specified
6433cb024174 Make ld wrapper more capable
lost@l-w.ca
parents: 179
diff changeset
60 # not supported by targets
6433cb024174 Make ld wrapper more capable
lost@l-w.ca
parents: 179
diff changeset
61 ;;
6433cb024174 Make ld wrapper more capable
lost@l-w.ca
parents: 179
diff changeset
62 -X)
6433cb024174 Make ld wrapper more capable
lost@l-w.ca
parents: 179
diff changeset
63 # strip unneeded stuff
6433cb024174 Make ld wrapper more capable
lost@l-w.ca
parents: 179
diff changeset
64 # ignored - really just a no-op
6433cb024174 Make ld wrapper more capable
lost@l-w.ca
parents: 179
diff changeset
65 ;;
72
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
66 -gn)
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
67 # Generate NoICE debug file
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
68 # ignored because debugging not supported by targets
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
69 ;;
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
70 -gs)
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
71 # Generate SDCC debug file
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
72 # ignored because debugging not supported by targets
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
73 ;;
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
74 -o)
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
75 output_file=$1; shift
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
76 ;;
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
77 -L*)
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
78 arg=${arg#-L}
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
79 libpaths="$libpaths --library-path=$arg"
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
80 ;;
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
81 -l*)
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
82 arg=${arg#-l}
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
83 libs="$libs --library=$arg"
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
84 ;;
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
85 --section-start)
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
86 section_value=$1; shift
197
82957c407577 Fix --section-start handling and add --map to ld wrapper.
William Astle <lost@l-w.ca>
parents: 184
diff changeset
87 options="$options --section-base=$section_value"
72
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
88 ;;
197
82957c407577 Fix --section-start handling and add --map to ld wrapper.
William Astle <lost@l-w.ca>
parents: 184
diff changeset
89
395
26d2791672b1 Update the "ld" wrapper
William Astle <lost@l-w.ca>
parents: 197
diff changeset
90 -Map=*)
26d2791672b1 Update the "ld" wrapper
William Astle <lost@l-w.ca>
parents: 197
diff changeset
91 arg=${arg#-Map=}; shift
26d2791672b1 Update the "ld" wrapper
William Astle <lost@l-w.ca>
parents: 197
diff changeset
92 options="$options --map=$arg"
197
82957c407577 Fix --section-start handling and add --map to ld wrapper.
William Astle <lost@l-w.ca>
parents: 184
diff changeset
93 ;;
82957c407577 Fix --section-start handling and add --map to ld wrapper.
William Astle <lost@l-w.ca>
parents: 184
diff changeset
94
395
26d2791672b1 Update the "ld" wrapper
William Astle <lost@l-w.ca>
parents: 197
diff changeset
95 --script=*)
26d2791672b1 Update the "ld" wrapper
William Astle <lost@l-w.ca>
parents: 197
diff changeset
96 options="$options $arg"
26d2791672b1 Update the "ld" wrapper
William Astle <lost@l-w.ca>
parents: 197
diff changeset
97 ;;
26d2791672b1 Update the "ld" wrapper
William Astle <lost@l-w.ca>
parents: 197
diff changeset
98 -T)
26d2791672b1 Update the "ld" wrapper
William Astle <lost@l-w.ca>
parents: 197
diff changeset
99 options="$options --script=$1"; shift
26d2791672b1 Update the "ld" wrapper
William Astle <lost@l-w.ca>
parents: 197
diff changeset
100 ;;
72
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
101 -Tbss)
197
82957c407577 Fix --section-start handling and add --map to ld wrapper.
William Astle <lost@l-w.ca>
parents: 184
diff changeset
102 options="$options --section-base=.bss=$1"; shift
72
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
103 ;;
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
104 -Tdata)
197
82957c407577 Fix --section-start handling and add --map to ld wrapper.
William Astle <lost@l-w.ca>
parents: 184
diff changeset
105 options="$options --section-base=.data=$1"; shift
72
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
106 ;;
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
107 -Ttext|-Tcode)
197
82957c407577 Fix --section-start handling and add --map to ld wrapper.
William Astle <lost@l-w.ca>
parents: 184
diff changeset
108 options="$options --section-base=.text=$1"; shift
72
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
109 ;;
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
110 -v|--verbose)
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
111 verbose=1
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
112 ;;
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
113 *crt0.o)
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
114 startup_files=$arg
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
115 ;;
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
116 -g)
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
117 # Ignored by GNU ld; we should do the same
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
118 ;;
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
119 -h|--help)
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
120 echo "ld (m6809)"
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
121 exit 0
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
122 ;;
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
123 --format-lwex)
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
124 options="$options --format=lwex"
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
125 ;;
179
606123758641 Added --sysroot support to lwlink and the ld wrapper script
lost@l-w.ca
parents: 79
diff changeset
126
606123758641 Added --sysroot support to lwlink and the ld wrapper script
lost@l-w.ca
parents: 79
diff changeset
127 --sysroot=*)
606123758641 Added --sysroot support to lwlink and the ld wrapper script
lost@l-w.ca
parents: 79
diff changeset
128 options="$options $arg"
606123758641 Added --sysroot support to lwlink and the ld wrapper script
lost@l-w.ca
parents: 79
diff changeset
129 ;;
606123758641 Added --sysroot support to lwlink and the ld wrapper script
lost@l-w.ca
parents: 79
diff changeset
130
606123758641 Added --sysroot support to lwlink and the ld wrapper script
lost@l-w.ca
parents: 79
diff changeset
131 -nostdlib)
606123758641 Added --sysroot support to lwlink and the ld wrapper script
lost@l-w.ca
parents: 79
diff changeset
132 stdlibpaths=
606123758641 Added --sysroot support to lwlink and the ld wrapper script
lost@l-w.ca
parents: 79
diff changeset
133 ;;
184
6433cb024174 Make ld wrapper more capable
lost@l-w.ca
parents: 179
diff changeset
134
6433cb024174 Make ld wrapper more capable
lost@l-w.ca
parents: 179
diff changeset
135 -e)
6433cb024174 Make ld wrapper more capable
lost@l-w.ca
parents: 179
diff changeset
136 options="$options --entry=$1"
6433cb024174 Make ld wrapper more capable
lost@l-w.ca
parents: 179
diff changeset
137 shift
6433cb024174 Make ld wrapper more capable
lost@l-w.ca
parents: 179
diff changeset
138 ;;
6433cb024174 Make ld wrapper more capable
lost@l-w.ca
parents: 179
diff changeset
139
6433cb024174 Make ld wrapper more capable
lost@l-w.ca
parents: 179
diff changeset
140 --entry)
6433cb024174 Make ld wrapper more capable
lost@l-w.ca
parents: 179
diff changeset
141 options="$options $arg"
6433cb024174 Make ld wrapper more capable
lost@l-w.ca
parents: 179
diff changeset
142 ;;
72
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
143
395
26d2791672b1 Update the "ld" wrapper
William Astle <lost@l-w.ca>
parents: 197
diff changeset
144 --relax)
26d2791672b1 Update the "ld" wrapper
William Astle <lost@l-w.ca>
parents: 197
diff changeset
145 ;;
26d2791672b1 Update the "ld" wrapper
William Astle <lost@l-w.ca>
parents: 197
diff changeset
146 --start-group)
26d2791672b1 Update the "ld" wrapper
William Astle <lost@l-w.ca>
parents: 197
diff changeset
147 ;;
26d2791672b1 Update the "ld" wrapper
William Astle <lost@l-w.ca>
parents: 197
diff changeset
148 --end-group)
26d2791672b1 Update the "ld" wrapper
William Astle <lost@l-w.ca>
parents: 197
diff changeset
149 ;;
26d2791672b1 Update the "ld" wrapper
William Astle <lost@l-w.ca>
parents: 197
diff changeset
150 --gc-sections)
26d2791672b1 Update the "ld" wrapper
William Astle <lost@l-w.ca>
parents: 197
diff changeset
151 ;;
72
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
152 -*)
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
153 echo "ld (m6809): unknown option $arg"
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
154 exit 1
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
155 ;;
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
156 *)
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
157 input_files="$input_files $arg"
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
158 ;;
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
159 esac
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
160 done
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
161
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
162 options="$options -o $output_file"
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
163
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
164 if [ "$verbose" = "1" ]; then
179
606123758641 Added --sysroot support to lwlink and the ld wrapper script
lost@l-w.ca
parents: 79
diff changeset
165 echo "$path_to_lwlink $options $input_files $startup_files $libpaths $stdlibpaths $libs"
72
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
166 fi
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
167
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
168 $path_to_lwlink $options $input_files $startup_files $libpaths $libs
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
169 rc=$?
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
170
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
171 if [ "$rc" != "0" ]; then
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
172 rm -f $output_file
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
173 exit $rc
84eb35251849 Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff changeset
174 fi