Fix for PR 16143 - set SEC_COMMON bit on .scommon, .zcommon and .tcommon sections.
[deliverable/binutils-gdb.git] / gas / README
CommitLineData
f1b4e131 1-*- text -*-
fecd2382 2
f1b4e131
KR
3 README for GAS 2.2.1 release
4 [cribbed largely from GDB's README file]
fecd2382 5
f1b4e131 6This is version 2.2.1 of the GNU assembler.
fecd2382 7
f1b4e131
KR
8A number of things have changed and the wonderful world of gas looks very
9different. There's still a lot of irrelevant garbage lying around that will
10be cleaned up in time. Documentation is scarce, as are logs of the changes
11made since the last gas release. My apologies, and I'll try to get something
12useful.
fecd2382 13
f1b4e131
KR
14Unpacking and Installation - Summary
15====================================
fecd2382 16
f1b4e131
KR
17In this release, the GNU assembler ("gas") sources, the generic GNU include
18files, the BFD ("binary file description") library, and other libraries all
19have directories of their own underneath the gas-2.2.1 directory. The idea is
20that a variety of GNU tools can share a common copy of these things.
21Configuration scripts and makefiles exist to cruise up and down this directory
22tree and automatically build all the pieces in the right order.
fecd2382 23
f1b4e131
KR
24When you unpack the gas-2.2.1.tar.z file, you'll find a directory called
25`gas-2.2.1'. To build GAS, you can just do:
fecd2382 26
f1b4e131
KR
27 cd gas-2.2.1
28 ./configure
29 make
30 cp gas/as.new /usr/local/bin/as (or whereever)
fecd2382 31
f1b4e131
KR
32This will configure and build all the libraries as well as GAS. If
33`configure' can't determine your system type, specify one as its argument,
34e.g., sun4 or decstation.
35
36If you get compiler warnings during this stage, see the `Reporting Bugs'
37section below; there are a few known problems.
38
39GAS can be used as a cross-assembler, running on a machine of one type while
40producing object files for a machine of another type. See below.
41
42Documentation
43=============
44
45The GAS release includes texinfo source for its manual, which can be processed
46into `info' or `dvi' forms.
47
48The DVI form is suitable for printing or displaying; the commands for doing
49this vary from system to system. On many systems, `lpr -d' will print a DVI
50file. On others, you may need to run a program such as `dvips' to convert the
51DVI file into a form your system can print.
fecd2382 52
f1b4e131
KR
53If you wish to build the DVI file, you will need to have TeX installed on your
54system. You can rebuild it by typing:
fecd2382 55
f1b4e131
KR
56 cd gas-2.2.1/gas/doc
57 make as.dvi
fecd2382 58
f1b4e131
KR
59The Info form is viewable with the GNU Emacs `info' subsystem, or the
60standalone `info' program, available as part of the GNU Texinfo distribution.
61To build the info files, you will need the `makeinfo' program. Type:
fecd2382 62
f1b4e131
KR
63 cd gas-2.2.1/gas/doc
64 make info
65
66Installing GAS
67==============
68
69GAS comes with a `configure' script that automates the process of preparing
70GAS for installation; you can then use `make' to build the program.
fecd2382 71
f1b4e131
KR
72The GAS distribution includes all the source code you need for GAS in a single
73directory, the name of which is usually composed by appending the version
74number to `gas'.
fecd2382 75
f1b4e131
KR
76The simplest way to configure and build GAS is to run `configure' from the
77`gas-VERSION-NUMBER' source directory, which in this example is the `gas-2.2.1'
78directory.
fecd2382 79
f1b4e131
KR
80First switch to the `gas-VERSION-NUMBER' source directory if you are not
81already in it; then run `configure'. Pass the identifier for the platform on
82which GAS will run as an argument. For example:
fecd2382 83
f1b4e131
KR
84 cd gas-2.2.1
85 ./configure HOST
86 make
fecd2382 87
f1b4e131
KR
88where HOST is an identifier such as `sun4' or `decstation', that identifies
89the platform where GAS will run.
fecd2382 90
f1b4e131
KR
91Running `configure HOST' followed by `make' builds the `bfd', `opcode', and
92`libiberty' libraries, then `gas' itself. (Exception: For VMS, the `bfd'
93library is not used.) The configured source files, and the binaries, are left
94in the corresponding source directories.
fecd2382 95
f1b4e131
KR
96The `configure' program is a Bourne-shell (`/bin/sh') script; if your system
97does not recognize this automatically when you run a different shell, you may
98need to run `sh' on it explicitly:
99
100 sh configure HOST
101
102If you run `configure' from a directory that contains source
103directories for multiple libraries or programs, such as the `gas-2.2.1'
104source directory for version 2.2.1, `configure' creates configuration
105files for every directory level underneath (unless you tell it not to,
106with the `--norecursion' option).
107
108You can run the `configure' script from any of the subordinate directories in
109the GAS distribution, if you only want to configure that subdirectory; but be
110sure to specify a path to it.
111
112For example, with version 2.2.1, type the following to configure only the `bfd'
113subdirectory:
114
115 cd gas-2.2.1/bfd
116 ../configure HOST
117
118Compiling GAS in another directory
119==================================
120
121 If you want to run GAS versions for several host or target machines,
122you need a different `gas' compiled for each combination of host and
123target. `configure' is designed to make this easy by allowing you to
124generate each configuration in a separate subdirectory, rather than in
125the source directory. If your `make' program handles the `VPATH'
126feature (GNU `make' does), running `make' in each of these directories
127builds the `gas' program specified there.
128
129 To build `gas in a separate directory, run `configure' with the
130`--srcdir' option to specify where to find the source. (You also need
131to specify a path to find `configure' itself from your working
132directory. If the path to `configure' would be the same as the
133argument to `--srcdir', you can leave out the `--srcdir' option; it
134will be assumed.)
135
136 For example, with version 2.2.1, you can build GAS in a separate
137directory for a Sun 4 like this:
138
139 cd gas-2.2.1
140 mkdir ../gas-sun4
141 cd ../gas-sun4
142 ../gas-2.2.1/configure sun4
143 make
144
145 When `configure' builds a configuration using a remote source
146directory, it creates a tree for the binaries with the same structure
147(and using the same names) as the tree under the source directory. In
148the example, you'd find the Sun 4 library `libiberty.a' in the
149directory `gas-sun4/libiberty', and GAS itself in `gas-sun4/gas'.
150
151 One popular reason to build several GAS configurations in separate
152directories is to configure GAS for cross-compiling (where GAS runs on
153one machine--the host--while debugging programs that run on another
154machine--the target). You specify a cross-debugging target by giving
155the `--target=TARGET' option to `configure'.
156
157 When you run `make' to build a program or library, you must run it
158in a configured directory--whatever directory you were in when you
159called `configure' (or one of its subdirectories).
160
161 The `Makefile' that `configure' generates in each source directory
162also runs recursively. If you type `make' in a source directory such
163as `gas-2.2.1' (or in a separate configured directory configured with
164`--srcdir=PATH/gas-2.2.1'), you will build all the required libraries,
165and then build GAS.
166
167 When you have multiple hosts or targets configured in separate
168directories, you can run `make' on them in parallel (for example, if
169they are NFS-mounted on each of the hosts); they will not interfere
170with each other.
171
172
173Specifying names for hosts and targets
174======================================
175
176 The specifications used for hosts and targets in the `configure'
177script are based on a three-part naming scheme, but some short
178predefined aliases are also supported. The full naming scheme encodes
179three pieces of information in the following pattern:
180
181 ARCHITECTURE-VENDOR-OS
182
183 For example, you can use the alias `sun4' as a HOST argument or in a
184`--target=TARGET' option. The equivalent full name is
185`sparc-sun-sunos4'.
186
187 The `configure' script accompanying GAS does not provide any query
188facility to list all supported host and target names or aliases.
189`configure' calls the Bourne shell script `config.sub' to map
190abbreviations to full names; you can read the script, if you wish, or
191you can use it to test your guesses on abbreviations--for example:
192
193 % sh config.sub sun4
194 sparc-sun-sunos411
195 % sh config.sub sun3
196 m68k-sun-sunos411
197 % sh config.sub decstation
198 mips-dec-ultrix42
199 % sh config.sub hp300bsd
200 m68k-hp-bsd
201 % sh config.sub i386v
202 i386-unknown-sysv
203 % sh config.sub i786v
204 Invalid configuration `i786v': machine `i786v' not recognized
205
206`config.sub' is also distributed in the GAS source directory
207(`gas-2.2.1', for version 2.2.1).
208
209
210`configure' options
211===================
212
213 Here is a summary of the `configure' options and arguments that are
214most often useful for building GAS. `configure' also has several other
215options not listed here.
216
217 configure [--help]
218 [--prefix=DIR]
219 [--srcdir=PATH]
220 [--norecursion] [--rm]
221 [--target=TARGET] HOST
222 [--with-OPTION]
223
224You may introduce options with a single `-' rather than `--' if you
225prefer; but you may abbreviate option names if you use `--'.
226
227`--help'
228 Display a quick summary of how to invoke `configure'.
229
230`-prefix=DIR'
231 Configure the source to install programs and files under directory
232 `DIR'.
233
234`--srcdir=PATH'
235 *Warning: using this option requires GNU `make', or another `make'
236 that implements the `VPATH' feature.*
237 Use this option to make configurations in directories separate
238 from the GAS source directories. Among other things, you can use
239 this to build (or maintain) several configurations simultaneously,
240 in separate directories. `configure' writes configuration
241 specific files in the current directory, but arranges for them to
242 use the source in the directory PATH. `configure' will create
243 directories under the working directory in parallel to the source
244 directories below PATH.
245
246`--norecursion'
247 Configure only the directory level where `configure' is executed;
248 do not propagate configuration to subdirectories.
249
250`--rm'
251 Remove the configuration that the other arguments specify.
252
253`--target=TARGET'
254 Configure GAS for cross-assembling programs for the specified
255 TARGET. Without this option, GAS is configured to assemble .o files
256 that run on the same machine (HOST) as GAS itself.
257
258 There is no convenient way to generate a list of all available
259 targets.
260
261`--with-OPTION'
262 These flags tell the program or library being configured to assume the
263 use of certain programs, or to otherwise configure themselves differently
264 from the default for the specified host/target combination. See below
265 for a list of `--with' options recognized in the gas-2.2.1 distribution.
266
267`HOST ...'
268 Configure GAS to run on the specified HOST.
269
270 There is no convenient way to generate a list of all available
271 hosts.
272
273`configure' accepts other options, for compatibility with configuring
274other GNU tools recursively; but these are the only options that affect
275GAS or its supporting libraries.
276
277The `--with' options recognized by software in the gas-2.2.1 distribution are:
278
279`--with-minimal-bfd'
280 This causes the BFD library, if it is used by the assembler, to only link
281 in support for the specified target; by default, support for all targets
282 known to BFD is linked in, even though the assembler generally won't
283 be able to use them. This will probably be made a default, or replaced
284 by a better mechanism, for gas-2.1.
285
286`--with-bfd-assembler'
287 This causes the assembler to use the new code being merged into it to use
288 BFD data structures internally, and use BFD for writing object files.
289 For most targets, this isn't supported yet. See `BFD CONVERSION' in the
290 file `gas/NOTES'.
291
292Supported platforms
293===================
294
295At this point I believe gas to be ansi only code for most target cpu's. That
296is, there should be relatively few, if any host system dependencies. So
297porting (as a cross-assembler) to hosts not yet supported should be fairly
298easy. Porting to a new target shouldn't be too tough if it's a variant of one
299already supported.
300
301Native assembling should work on:
302
303 sun3
304 sun4
305 386bsd
306 bsd/386?
307 linux
308 m68k hpux 8.0 (hpux 7.0 may be a problem)
309 vax bsd, ultrix, vms
310 hp9000s300
311 decstation
312 iris
313 miniframe (m68k-sysv from Convergent Technologies)
314 i386-aix (ps/2)
315
316For cross-assemblers, I believe hosting to work on any of the machines listed
317above, plus:
318
319 rs6000
320 sun386i
321 at least some flavors of hpux (hpux 7.0 may be a problem)
322 most flavors of sysV
323
324I believe that gas as a cross-assembler can currently be targetted for:
325
326 386bsd
327 bsd/386?
328 decstation-bsd (a.out format, to be used in BSD 4.4)
329 ebmon29k
330 go32 (DOS on i386, with DJGPP)
331 h8/300, h8/500 (Hitachi)
332 hp9000/300
333 i386-aix (ps/2)
334 i960-coff
335 linux
336 mips ecoff (decstation-ultrix, iris, mips magnum)
337 nindy960
338 sco386
339 sun3
340 sun4
341 vax bsd or ultrix?
342 vms
343 vxworks68k
344 vxworks960
345 z8000 (Zilog)
346
347MIPS ECOFF support has been added, but GAS will not run a C-style
348preprocessor. If you want that, rename your file to have a ".S" suffix, and
349run gcc on it.
350
351Support for ns32k, tahoe, i860, m88k may be suffering from bitrot.
352
353Support for ELF is being worked on. It should be available in version 2.2.
354
355This version does not support the IBM RS/6000. I am not aware of any work
356being done to support it. If you are interested in working on it, please
357contact me.
358
359This version does not support the HP PA/RISC running HP/UX. A modified version
360of gas 1.36 which does (well enough for gcc) is available by ftp from
361jaguar.cs.utah.edu.
362
363If you try out gas on some host or target not listed above, please let me know
364the results, so I can update the list.
365
366Compiler Support Hacks
367======================
368
369The assembler has been modified to support a feature that is potentially
370useful when assembling compiler output, but which may confuse assembly
371language programmers. If assembler encounters a .word pseudo-op of the form
372symbol1-symbol2 (the difference of two symbols), and the difference of those
373two symbols will not fit in 16 bits, the assembler will create a branch around
374a long jump to symbol1, and insert this into the output directly before the
375next label: The .word will (instead of containing garbage, or giving an error
376message) contain (the address of the long jump)-symbol2. This allows the
377assembler to assemble jump tables that jump to locations very far away into
378code that works properly. If the next label is more than 32K away from the
379.word, you lose (silently); RMS claims this will never happen. If the -K
380option is given, you will get a warning message when this happens.
381
382
383REPORTING BUGS IN GAS
384=====================
385
386Bugs in gas should be reported to bug-gnu-utils@prep.ai.mit.edu. They may be
387cross-posted to bug-gcc if they affect the use of gas with gcc. They should
388not be reported just to bug-gcc, since I don't read that list, and therefore
389wouldn't see them.
fecd2382 390
f1b4e131
KR
391If you report a bug in GAS, please remember to include:
392
393A description of exactly what went wrong, and exactly what should have
394happened instead.
395
396The type of machine (VAX, 68020, etc) and operating system (BSD, SunOS, DYNIX,
397VMS, etc) GAS was running on.
fecd2382 398
f1b4e131
KR
399The configuration name(s) given to the "configure" script. The
400"config.status" file should have this information.
401
402The options given to GAS at run time.
403
404The actual input file that caused the problem.
fecd2382 405
f1b4e131
KR
406It is silly to report a bug in GAS without including an input file for GAS.
407Don't ask us to generate the file just because you made it from files you
408think we have access to.
409
4101. You might be mistaken.
4112. It might take us a lot of time to install things to regenerate that file.
4123. We might get a different file from the one you got, and might not see any
413bug.
fecd2382 414
f1b4e131
KR
415To save us these delays and uncertainties, always send the input file for the
416program that failed. A smaller test case that demonstrates the problem is of
417course preferable, but be sure it is a complete input file, and that it really
418does demonstrate the problem; but if paring it down would cause large delays
419in filing the bug report, don't bother.
fecd2382 420
f1b4e131
KR
421If the input file is very large, and you are on the internet, you may want to
422make it avaliable for anonymous FTP instead of mailing it. If you do, include
423instructions for FTP'ing it in your bug report.
fecd2382 424
f1b4e131
KR
425If you expect to be contributing a large number of test cases, it would be
426helpful if you would look at the test suite included in the release (based on
427the Deja Gnu testing framework, available from the usual ftp sites) and write
428test cases to fit into that framework. This is certainly not required.
This page took 0.394982 seconds and 4 git commands to generate.