1\input texinfo @c -*-Texinfo-*- 2@c Copyright (C) 1991-2024 Free Software Foundation, Inc. 3@c UPDATE!! On future updates-- 4@c (1) check for new machine-dep cmdline options in 5@c md_parse_option definitions in config/tc-*.c 6@c (2) for platform-specific directives, examine md_pseudo_op 7@c in config/tc-*.c 8@c (3) for object-format specific directives, examine obj_pseudo_op 9@c in config/obj-*.c 10@c (4) portable directives in potable[] in read.c 11@c %**start of header 12@setfilename as.info 13@c ---config--- 14@macro gcctabopt{body} 15@code{\body\} 16@end macro 17@c defaults, config file may override: 18@set have-stabs 19@c --- 20@c man begin NAME 21@c --- 22@include asconfig.texi 23@include bfdver.texi 24@c --- 25@c man end 26@c --- 27@c common OR combinations of conditions 28@ifset COFF 29@set COFF-ELF 30@end ifset 31@ifset ELF 32@set COFF-ELF 33@end ifset 34@ifset AOUT 35@set aout 36@end ifset 37@ifset ARM/Thumb 38@set ARM 39@end ifset 40@ifset Blackfin 41@set Blackfin 42@end ifset 43@ifset BPF 44@set BPF 45@end ifset 46@ifset H8/300 47@set H8 48@end ifset 49@ifset SH 50@set H8 51@end ifset 52@ifset HPPA 53@set abnormal-separator 54@end ifset 55@c ------------ 56@ifset GENERIC 57@settitle Using @value{AS} 58@end ifset 59@ifclear GENERIC 60@settitle Using @value{AS} (@value{TARGET}) 61@end ifclear 62@setchapternewpage odd 63@c %**end of header 64 65@c @smallbook 66@c @set SMALL 67@c WARE! Some of the machine-dependent sections contain tables of machine 68@c instructions. Except in multi-column format, these tables look silly. 69@c Unfortunately, Texinfo doesn't have a general-purpose multi-col format, so 70@c the multi-col format is faked within @example sections. 71@c 72@c Again unfortunately, the natural size that fits on a page, for these tables, 73@c is different depending on whether or not smallbook is turned on. 74@c This matters, because of order: text flow switches columns at each page 75@c break. 76@c 77@c The format faked in this source works reasonably well for smallbook, 78@c not well for the default large-page format. This manual expects that if you 79@c turn on @smallbook, you will also uncomment the "@set SMALL" to enable the 80@c tables in question. You can turn on one without the other at your 81@c discretion, of course. 82@ifinfo 83@set SMALL 84@c the insn tables look just as silly in info files regardless of smallbook, 85@c might as well show 'em anyways. 86@end ifinfo 87 88@ifnottex 89@dircategory Software development 90@direntry 91* As: (as). The GNU assembler. 92* Gas: (as). The GNU assembler. 93@end direntry 94@end ifnottex 95 96@finalout 97@syncodeindex ky cp 98 99@copying 100This file documents the GNU Assembler "@value{AS}". 101 102@c man begin COPYRIGHT 103Copyright @copyright{} 1991-2024 Free Software Foundation, Inc. 104 105Permission is granted to copy, distribute and/or modify this document 106under the terms of the GNU Free Documentation License, Version 1.3 107or any later version published by the Free Software Foundation; 108with no Invariant Sections, with no Front-Cover Texts, and with no 109Back-Cover Texts. A copy of the license is included in the 110section entitled ``GNU Free Documentation License''. 111 112@c man end 113@end copying 114 115@titlepage 116@title Using @value{AS} 117@subtitle The @sc{gnu} Assembler 118@ifclear GENERIC 119@subtitle for the @value{TARGET} family 120@end ifclear 121@ifset VERSION_PACKAGE 122@sp 1 123@subtitle @value{VERSION_PACKAGE} 124@end ifset 125@sp 1 126@subtitle Version @value{VERSION} 127@sp 1 128@sp 13 129The Free Software Foundation Inc.@: thanks The Nice Computer 130Company of Australia for loaning Dean Elsner to write the 131first (Vax) version of @command{as} for Project @sc{gnu}. 132The proprietors, management and staff of TNCCA thank FSF for 133distracting the boss while they got some work 134done. 135@sp 3 136@author Dean Elsner, Jay Fenlason & friends 137@page 138@tex 139{\parskip=0pt 140\hfill {\it Using {\tt @value{AS}}}\par 141\hfill Edited by Cygnus Support\par 142} 143%"boxit" macro for figures: 144%Modified from Knuth's ``boxit'' macro from TeXbook (answer to exercise 21.3) 145\gdef\boxit#1#2{\vbox{\hrule\hbox{\vrule\kern3pt 146 \vbox{\parindent=0pt\parskip=0pt\hsize=#1\kern3pt\strut\hfil 147#2\hfil\strut\kern3pt}\kern3pt\vrule}\hrule}}%box with visible outline 148\gdef\ibox#1#2{\hbox to #1{#2\hfil}\kern8pt}% invisible box 149@end tex 150 151@vskip 0pt plus 1filll 152Copyright @copyright{} 1991-2024 Free Software Foundation, Inc. 153 154 Permission is granted to copy, distribute and/or modify this document 155 under the terms of the GNU Free Documentation License, Version 1.3 156 or any later version published by the Free Software Foundation; 157 with no Invariant Sections, with no Front-Cover Texts, and with no 158 Back-Cover Texts. A copy of the license is included in the 159 section entitled ``GNU Free Documentation License''. 160 161@end titlepage 162@contents 163 164@ifnottex 165@node Top 166@top Using @value{AS} 167 168This file is a user guide to the @sc{gnu} assembler @command{@value{AS}} 169@ifset VERSION_PACKAGE 170@value{VERSION_PACKAGE} 171@end ifset 172version @value{VERSION}. 173@ifclear GENERIC 174This version of the file describes @command{@value{AS}} configured to generate 175code for @value{TARGET} architectures. 176@end ifclear 177 178This document is distributed under the terms of the GNU Free 179Documentation License. A copy of the license is included in the 180section entitled ``GNU Free Documentation License''. 181 182@menu 183* Overview:: Overview 184* Invoking:: Command-Line Options 185* Syntax:: Syntax 186* Sections:: Sections and Relocation 187* Symbols:: Symbols 188* Expressions:: Expressions 189* Pseudo Ops:: Assembler Directives 190@ifset ELF 191* Object Attributes:: Object Attributes 192@end ifset 193* Machine Dependencies:: Machine Dependent Features 194* Reporting Bugs:: Reporting Bugs 195* Acknowledgements:: Who Did What 196* GNU Free Documentation License:: GNU Free Documentation License 197* AS Index:: AS Index 198@end menu 199@end ifnottex 200 201@node Overview 202@chapter Overview 203@iftex 204This manual is a user guide to the @sc{gnu} assembler @command{@value{AS}}. 205@ifclear GENERIC 206This version of the manual describes @command{@value{AS}} configured to generate 207code for @value{TARGET} architectures. 208@end ifclear 209@end iftex 210 211@cindex invocation summary 212@cindex option summary 213@cindex summary of options 214Here is a brief summary of how to invoke @command{@value{AS}}. For details, 215see @ref{Invoking,,Command-Line Options}. 216 217@c man title AS the portable GNU assembler. 218 219@ignore 220@c man begin SEEALSO 221gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. 222@c man end 223@end ignore 224 225@c We don't use deffn and friends for the following because they seem 226@c to be limited to one line for the header. 227@smallexample 228@c man begin SYNOPSIS 229@value{AS} [@b{-a}[@b{cdghilns}][=@var{file}]] 230 [@b{--alternate}] 231 [@b{--compress-debug-sections}] [@b{--nocompress-debug-sections}] 232 [@b{-D}] 233 [@b{--dump-config}] 234 [@b{--debug-prefix-map} @var{old}=@var{new}] 235 [@b{--defsym} @var{sym}=@var{val}] 236 [@b{--elf-stt-common=[no|yes]}] 237 [@b{--emulation}=@var{name}] 238 [@b{-f}] 239 [@b{-g}] [@b{--gstabs}] [@b{--gstabs+}] 240 [@b{--gdwarf-<N>}] [@b{--gdwarf-sections}] 241 [@b{--gdwarf-cie-version}=@var{VERSION}] 242 [@b{--generate-missing-build-notes=[no|yes]}] 243 [@b{--gsframe}] 244 [@b{--hash-size}=@var{N}] 245 [@b{--help}] [@b{--target-help}] 246 [@b{-I} @var{dir}] 247 [@b{-J}] 248 [@b{-K}] 249 [@b{--keep-locals}] 250 [@b{-L}] 251 [@b{--listing-lhs-width}=@var{NUM}] 252 [@b{--listing-lhs-width2}=@var{NUM}] 253 [@b{--listing-rhs-width}=@var{NUM}] 254 [@b{--listing-cont-lines}=@var{NUM}] 255 [@b{--multibyte-handling=[allow|warn|warn-sym-only]}] 256 [@b{--no-pad-sections}] 257 [@b{-o} @var{objfile}] [@b{-R}] 258 [@b{--scfi=experimental}] 259 [@b{--sectname-subst}] 260 [@b{--size-check=[error|warning]}] 261 [@b{--statistics}] 262 [@b{-v}] [@b{-version}] [@b{--version}] 263 [@b{-W}] [@b{--warn}] [@b{--fatal-warnings}] [@b{-w}] [@b{-x}] 264 [@b{-Z}] [@b{@@@var{FILE}}] 265 [@var{target-options}] 266 [@b{--}|@var{files} @dots{}] 267@c 268@c man end 269@c Target dependent options are listed below. Keep the list sorted. 270@c Add an empty line for separation. 271@c man begin TARGET 272@ifset AARCH64 273 274@emph{Target AArch64 options:} 275 [@b{-EB}|@b{-EL}] 276 [@b{-mabi}=@var{ABI}] 277@end ifset 278@ifset ALPHA 279 280@emph{Target Alpha options:} 281 [@b{-m@var{cpu}}] 282 [@b{-mdebug} | @b{-no-mdebug}] 283 [@b{-replace} | @b{-noreplace}] 284 [@b{-relax}] [@b{-g}] [@b{-G@var{size}}] 285 [@b{-F}] [@b{-32addr}] 286@end ifset 287@ifset ARC 288 289@emph{Target ARC options:} 290 [@b{-mcpu=@var{cpu}}] 291 [@b{-mA6}|@b{-mARC600}|@b{-mARC601}|@b{-mA7}|@b{-mARC700}|@b{-mEM}|@b{-mHS}] 292 [@b{-mcode-density}] 293 [@b{-mrelax}] 294 [@b{-EB}|@b{-EL}] 295@end ifset 296@ifset ARM 297 298@emph{Target ARM options:} 299@c Don't document the deprecated options 300 [@b{-mcpu}=@var{processor}[+@var{extension}@dots{}]] 301 [@b{-march}=@var{architecture}[+@var{extension}@dots{}]] 302 [@b{-mfpu}=@var{floating-point-format}] 303 [@b{-mfloat-abi}=@var{abi}] 304 [@b{-meabi}=@var{ver}] 305 [@b{-mthumb}] 306 [@b{-EB}|@b{-EL}] 307 [@b{-mapcs-32}|@b{-mapcs-26}|@b{-mapcs-float}| 308 @b{-mapcs-reentrant}] 309 [@b{-mthumb-interwork}] [@b{-k}] 310@end ifset 311@ifset Blackfin 312 313@emph{Target Blackfin options:} 314 [@b{-mcpu}=@var{processor}[-@var{sirevision}]] 315 [@b{-mfdpic}] 316 [@b{-mno-fdpic}] 317 [@b{-mnopic}] 318@end ifset 319@ifset BPF 320 321@emph{Target BPF options:} 322 [@b{-EL}] [@b{-EB}] 323@end ifset 324@ifset CRIS 325 326@emph{Target CRIS options:} 327 [@b{--underscore} | @b{--no-underscore}] 328 [@b{--pic}] [@b{-N}] 329 [@b{--emulation=criself} | @b{--emulation=crisaout}] 330 [@b{--march=v0_v10} | @b{--march=v10} | @b{--march=v32} | @b{--march=common_v10_v32}] 331@c Deprecated -- deliberately not documented. 332@c [@b{-h}] [@b{-H}] 333@end ifset 334@ifset CSKY 335 336@emph{Target C-SKY options:} 337 [@b{-march=@var{arch}}] [@b{-mcpu=@var{cpu}}] 338 [@b{-EL}] [@b{-mlittle-endian}] [@b{-EB}] [@b{-mbig-endian}] 339 [@b{-fpic}] [@b{-pic}] 340 [@b{-mljump}] [@b{-mno-ljump}] 341 [@b{-force2bsr}] [@b{-mforce2bsr}] [@b{-no-force2bsr}] [@b{-mno-force2bsr}] 342 [@b{-jsri2bsr}] [@b{-mjsri2bsr}] [@b{-no-jsri2bsr }] [@b{-mno-jsri2bsr}] 343 [@b{-mnolrw }] [@b{-mno-lrw}] 344 [@b{-melrw}] [@b{-mno-elrw}] 345 [@b{-mlaf }] [@b{-mliterals-after-func}] 346 [@b{-mno-laf}] [@b{-mno-literals-after-func}] 347 [@b{-mlabr}] [@b{-mliterals-after-br}] 348 [@b{-mno-labr}] [@b{-mnoliterals-after-br}] 349 [@b{-mistack}] [@b{-mno-istack}] 350 [@b{-mhard-float}] [@b{-mmp}] [@b{-mcp}] [@b{-mcache}] 351 [@b{-msecurity}] [@b{-mtrust}] 352 [@b{-mdsp}] [@b{-medsp}] [@b{-mvdsp}] 353@end ifset 354@ifset D10V 355 356@emph{Target D10V options:} 357 [@b{-O}] 358@end ifset 359@ifset D30V 360 361@emph{Target D30V options:} 362 [@b{-O}|@b{-n}|@b{-N}] 363@end ifset 364@ifset EPIPHANY 365 366@emph{Target EPIPHANY options:} 367 [@b{-mepiphany}|@b{-mepiphany16}] 368@end ifset 369@ifset H8 370 371@emph{Target H8/300 options:} 372 [-h-tick-hex] 373@end ifset 374@ifset HPPA 375@c HPPA has no machine-dependent assembler options (yet). 376@end ifset 377@ifset I80386 378 379@emph{Target i386 options:} 380 [@b{--32}|@b{--x32}|@b{--64}] [@b{-n}] 381 [@b{-march}=@var{CPU}[+@var{EXTENSION}@dots{}]] [@b{-mtune}=@var{CPU}] 382@end ifset 383@ifset IA64 384 385@emph{Target IA-64 options:} 386 [@b{-mconstant-gp}|@b{-mauto-pic}] 387 [@b{-milp32}|@b{-milp64}|@b{-mlp64}|@b{-mp64}] 388 [@b{-mle}|@b{mbe}] 389 [@b{-mtune=itanium1}|@b{-mtune=itanium2}] 390 [@b{-munwind-check=warning}|@b{-munwind-check=error}] 391 [@b{-mhint.b=ok}|@b{-mhint.b=warning}|@b{-mhint.b=error}] 392 [@b{-x}|@b{-xexplicit}] [@b{-xauto}] [@b{-xdebug}] 393@end ifset 394@ifset IP2K 395 396@emph{Target IP2K options:} 397 [@b{-mip2022}|@b{-mip2022ext}] 398@end ifset 399@ifset LOONGARCH 400 401@emph{Target LOONGARCH options:} 402 [@b{-fpic}|@b{-fPIC}|@b{-fno-pic}] 403@end ifset 404@ifset M32C 405 406@emph{Target M32C options:} 407 [@b{-m32c}|@b{-m16c}] [-relax] [-h-tick-hex] 408@end ifset 409@ifset M32R 410 411@emph{Target M32R options:} 412 [@b{--m32rx}|@b{--[no-]warn-explicit-parallel-conflicts}| 413 @b{--W[n]p}] 414@end ifset 415@ifset M680X0 416 417@emph{Target M680X0 options:} 418 [@b{-l}] [@b{-m68000}|@b{-m68010}|@b{-m68020}|@dots{}] 419@end ifset 420@ifset M68HC11 421 422@emph{Target M68HC11 options:} 423 [@b{-m68hc11}|@b{-m68hc12}|@b{-m68hcs12}|@b{-mm9s12x}|@b{-mm9s12xg}] 424 [@b{-mshort}|@b{-mlong}] 425 [@b{-mshort-double}|@b{-mlong-double}] 426 [@b{--force-long-branches}] [@b{--short-branches}] 427 [@b{--strict-direct-mode}] [@b{--print-insn-syntax}] 428 [@b{--print-opcodes}] [@b{--generate-example}] 429@end ifset 430@ifset MCORE 431 432@emph{Target MCORE options:} 433 [@b{-jsri2bsr}] [@b{-sifilter}] [@b{-relax}] 434 [@b{-mcpu=[210|340]}] 435@end ifset 436@ifset METAG 437 438@emph{Target Meta options:} 439 [@b{-mcpu=@var{cpu}}] [@b{-mfpu=@var{cpu}}] [@b{-mdsp=@var{cpu}}] 440@end ifset 441@ifset MICROBLAZE 442@emph{Target MICROBLAZE options:} 443 [@b{-mlittle-endian}] [@b{-mbig-endian}] 444@end ifset 445@ifset MIPS 446 447@emph{Target MIPS options:} 448 [@b{-nocpp}] [@b{-EL}] [@b{-EB}] [@b{-O}[@var{optimization level}]] 449 [@b{-g}[@var{debug level}]] [@b{-G} @var{num}] [@b{-KPIC}] [@b{-call_shared}] 450 [@b{-non_shared}] [@b{-xgot} [@b{-mvxworks-pic}] 451 [@b{-mabi}=@var{ABI}] [@b{-32}] [@b{-n32}] [@b{-64}] [@b{-mfp32}] [@b{-mgp32}] 452 [@b{-mfp64}] [@b{-mgp64}] [@b{-mfpxx}] 453 [@b{-modd-spreg}] [@b{-mno-odd-spreg}] 454 [@b{-march}=@var{CPU}] [@b{-mtune}=@var{CPU}] [@b{-mips1}] [@b{-mips2}] 455 [@b{-mips3}] [@b{-mips4}] [@b{-mips5}] [@b{-mips32}] [@b{-mips32r2}] 456 [@b{-mips32r3}] [@b{-mips32r5}] [@b{-mips32r6}] [@b{-mips64}] [@b{-mips64r2}] 457 [@b{-mips64r3}] [@b{-mips64r5}] [@b{-mips64r6}] 458 [@b{-construct-floats}] [@b{-no-construct-floats}] 459 [@b{-mignore-branch-isa}] [@b{-mno-ignore-branch-isa}] 460 [@b{-mnan=@var{encoding}}] 461 [@b{-trap}] [@b{-no-break}] [@b{-break}] [@b{-no-trap}] 462 [@b{-mips16}] [@b{-no-mips16}] 463 [@b{-mmips16e2}] [@b{-mno-mips16e2}] 464 [@b{-mmicromips}] [@b{-mno-micromips}] 465 [@b{-msmartmips}] [@b{-mno-smartmips}] 466 [@b{-mips3d}] [@b{-no-mips3d}] 467 [@b{-mdmx}] [@b{-no-mdmx}] 468 [@b{-mdsp}] [@b{-mno-dsp}] 469 [@b{-mdspr2}] [@b{-mno-dspr2}] 470 [@b{-mdspr3}] [@b{-mno-dspr3}] 471 [@b{-mmsa}] [@b{-mno-msa}] 472 [@b{-mxpa}] [@b{-mno-xpa}] 473 [@b{-mmt}] [@b{-mno-mt}] 474 [@b{-mmcu}] [@b{-mno-mcu}] 475 [@b{-mcrc}] [@b{-mno-crc}] 476 [@b{-mginv}] [@b{-mno-ginv}] 477 [@b{-mloongson-mmi}] [@b{-mno-loongson-mmi}] 478 [@b{-mloongson-cam}] [@b{-mno-loongson-cam}] 479 [@b{-mloongson-ext}] [@b{-mno-loongson-ext}] 480 [@b{-mloongson-ext2}] [@b{-mno-loongson-ext2}] 481 [@b{-minsn32}] [@b{-mno-insn32}] 482 [@b{-mfix7000}] [@b{-mno-fix7000}] 483 [@b{-mfix-rm7000}] [@b{-mno-fix-rm7000}] 484 [@b{-mfix-vr4120}] [@b{-mno-fix-vr4120}] 485 [@b{-mfix-vr4130}] [@b{-mno-fix-vr4130}] 486 [@b{-mfix-r5900}] [@b{-mno-fix-r5900}] 487 [@b{-mdebug}] [@b{-no-mdebug}] 488 [@b{-mpdr}] [@b{-mno-pdr}] 489@end ifset 490@ifset MMIX 491 492@emph{Target MMIX options:} 493 [@b{--fixed-special-register-names}] [@b{--globalize-symbols}] 494 [@b{--gnu-syntax}] [@b{--relax}] [@b{--no-predefined-symbols}] 495 [@b{--no-expand}] [@b{--no-merge-gregs}] [@b{-x}] 496 [@b{--linker-allocated-gregs}] 497@end ifset 498@ifset NIOSII 499 500@emph{Target Nios II options:} 501 [@b{-relax-all}] [@b{-relax-section}] [@b{-no-relax}] 502 [@b{-EB}] [@b{-EL}] 503@end ifset 504@ifset NDS32 505 506@emph{Target NDS32 options:} 507 [@b{-EL}] [@b{-EB}] [@b{-O}] [@b{-Os}] [@b{-mcpu=@var{cpu}}] 508 [@b{-misa=@var{isa}}] [@b{-mabi=@var{abi}}] [@b{-mall-ext}] 509 [@b{-m[no-]16-bit}] [@b{-m[no-]perf-ext}] [@b{-m[no-]perf2-ext}] 510 [@b{-m[no-]string-ext}] [@b{-m[no-]dsp-ext}] [@b{-m[no-]mac}] [@b{-m[no-]div}] 511 [@b{-m[no-]audio-isa-ext}] [@b{-m[no-]fpu-sp-ext}] [@b{-m[no-]fpu-dp-ext}] 512 [@b{-m[no-]fpu-fma}] [@b{-mfpu-freg=@var{FREG}}] [@b{-mreduced-regs}] 513 [@b{-mfull-regs}] [@b{-m[no-]dx-regs}] [@b{-mpic}] [@b{-mno-relax}] 514 [@b{-mb2bb}] 515@end ifset 516@ifset OPENRISC 517@c OpenRISC has no machine-dependent assembler options. 518@end ifset 519@ifset PDP11 520 521@emph{Target PDP11 options:} 522 [@b{-mpic}|@b{-mno-pic}] [@b{-mall}] [@b{-mno-extensions}] 523 [@b{-m}@var{extension}|@b{-mno-}@var{extension}] 524 [@b{-m}@var{cpu}] [@b{-m}@var{machine}] 525@end ifset 526@ifset PJ 527 528@emph{Target picoJava options:} 529 [@b{-mb}|@b{-me}] 530@end ifset 531@ifset PPC 532 533@emph{Target PowerPC options:} 534 [@b{-a32}|@b{-a64}] 535 [@b{-mpwrx}|@b{-mpwr2}|@b{-mpwr}|@b{-m601}|@b{-mppc}|@b{-mppc32}|@b{-m603}|@b{-m604}|@b{-m403}|@b{-m405}| 536 @b{-m440}|@b{-m464}|@b{-m476}|@b{-m7400}|@b{-m7410}|@b{-m7450}|@b{-m7455}|@b{-m750cl}|@b{-mgekko}| 537 @b{-mbroadway}|@b{-mppc64}|@b{-m620}|@b{-me500}|@b{-e500x2}|@b{-me500mc}|@b{-me500mc64}|@b{-me5500}| 538 @b{-me6500}|@b{-mppc64bridge}|@b{-mbooke}|@b{-mpower4}|@b{-mpwr4}|@b{-mpower5}|@b{-mpwr5}|@b{-mpwr5x}| 539 @b{-mpower6}|@b{-mpwr6}|@b{-mpower7}|@b{-mpwr7}|@b{-mpower8}|@b{-mpwr8}|@b{-mpower9}|@b{-mpwr9}@b{-ma2}| 540 @b{-mcell}|@b{-mspe}|@b{-mspe2}|@b{-mtitan}|@b{-me300}|@b{-mcom}] 541 [@b{-many}] [@b{-maltivec}|@b{-mvsx}|@b{-mhtm}|@b{-mvle}] 542 [@b{-mregnames}|@b{-mno-regnames}] 543 [@b{-mrelocatable}|@b{-mrelocatable-lib}|@b{-K PIC}] [@b{-memb}] 544 [@b{-mlittle}|@b{-mlittle-endian}|@b{-le}|@b{-mbig}|@b{-mbig-endian}|@b{-be}] 545 [@b{-msolaris}|@b{-mno-solaris}] 546 [@b{-nops=@var{count}}] 547@end ifset 548@ifset PRU 549 550@emph{Target PRU options:} 551 [@b{-link-relax}] 552 [@b{-mnolink-relax}] 553 [@b{-mno-warn-regname-label}] 554@end ifset 555@ifset RISCV 556 557@emph{Target RISC-V options:} 558 [@b{-fpic}|@b{-fPIC}|@b{-fno-pic}] 559 [@b{-march}=@var{ISA}] 560 [@b{-mabi}=@var{ABI}] 561 [@b{-mlittle-endian}|@b{-mbig-endian}] 562@end ifset 563@ifset RL78 564 565@emph{Target RL78 options:} 566 [@b{-mg10}] 567 [@b{-m32bit-doubles}|@b{-m64bit-doubles}] 568@end ifset 569@ifset RX 570 571@emph{Target RX options:} 572 [@b{-mlittle-endian}|@b{-mbig-endian}] 573 [@b{-m32bit-doubles}|@b{-m64bit-doubles}] 574 [@b{-muse-conventional-section-names}] 575 [@b{-msmall-data-limit}] 576 [@b{-mpid}] 577 [@b{-mrelax}] 578 [@b{-mint-register=@var{number}}] 579 [@b{-mgcc-abi}|@b{-mrx-abi}] 580@end ifset 581@ifset S390 582 583@emph{Target s390 options:} 584 [@b{-m31}|@b{-m64}] [@b{-mesa}|@b{-mzarch}] [@b{-march}=@var{CPU}] 585 [@b{-mregnames}|@b{-mno-regnames}] 586 [@b{-mwarn-areg-zero}] 587@end ifset 588@ifset SCORE 589 590@emph{Target SCORE options:} 591 [@b{-EB}][@b{-EL}][@b{-FIXDD}][@b{-NWARN}] 592 [@b{-SCORE5}][@b{-SCORE5U}][@b{-SCORE7}][@b{-SCORE3}] 593 [@b{-march=score7}][@b{-march=score3}] 594 [@b{-USE_R1}][@b{-KPIC}][@b{-O0}][@b{-G} @var{num}][@b{-V}] 595@end ifset 596@ifset SPARC 597 598@emph{Target SPARC options:} 599@c The order here is important. See c-sparc.texi. 600 [@b{-Av6}|@b{-Av7}|@b{-Av8}|@b{-Aleon}|@b{-Asparclet}|@b{-Asparclite} 601 @b{-Av8plus}|@b{-Av8plusa}|@b{-Av8plusb}|@b{-Av8plusc}|@b{-Av8plusd} 602 @b{-Av8plusv}|@b{-Av8plusm}|@b{-Av9}|@b{-Av9a}|@b{-Av9b}|@b{-Av9c} 603 @b{-Av9d}|@b{-Av9e}|@b{-Av9v}|@b{-Av9m}|@b{-Asparc}|@b{-Asparcvis} 604 @b{-Asparcvis2}|@b{-Asparcfmaf}|@b{-Asparcima}|@b{-Asparcvis3} 605 @b{-Asparcvisr}|@b{-Asparc5}] 606 [@b{-xarch=v8plus}|@b{-xarch=v8plusa}]|@b{-xarch=v8plusb}|@b{-xarch=v8plusc} 607 @b{-xarch=v8plusd}|@b{-xarch=v8plusv}|@b{-xarch=v8plusm}|@b{-xarch=v9} 608 @b{-xarch=v9a}|@b{-xarch=v9b}|@b{-xarch=v9c}|@b{-xarch=v9d}|@b{-xarch=v9e} 609 @b{-xarch=v9v}|@b{-xarch=v9m}|@b{-xarch=sparc}|@b{-xarch=sparcvis} 610 @b{-xarch=sparcvis2}|@b{-xarch=sparcfmaf}|@b{-xarch=sparcima} 611 @b{-xarch=sparcvis3}|@b{-xarch=sparcvisr}|@b{-xarch=sparc5} 612 @b{-bump}] 613 [@b{-32}|@b{-64}] 614 [@b{--enforce-aligned-data}][@b{--dcti-couples-detect}] 615@end ifset 616@ifset TIC54X 617 618@emph{Target TIC54X options:} 619 [@b{-mcpu=54[123589]}|@b{-mcpu=54[56]lp}] [@b{-mfar-mode}|@b{-mf}] 620 [@b{-merrors-to-file} @var{<filename>}|@b{-me} @var{<filename>}] 621@end ifset 622@ifset TIC6X 623 624@emph{Target TIC6X options:} 625 [@b{-march=@var{arch}}] [@b{-mbig-endian}|@b{-mlittle-endian}] 626 [@b{-mdsbt}|@b{-mno-dsbt}] [@b{-mpid=no}|@b{-mpid=near}|@b{-mpid=far}] 627 [@b{-mpic}|@b{-mno-pic}] 628@end ifset 629@ifset TILEGX 630 631@emph{Target TILE-Gx options:} 632 [@b{-m32}|@b{-m64}][@b{-EB}][@b{-EL}] 633@end ifset 634@ifset TILEPRO 635@c TILEPro has no machine-dependent assembler options 636@end ifset 637@ifset VISIUM 638 639@emph{Target Visium options:} 640 [@b{-mtune=@var{arch}}] 641@end ifset 642@ifset XTENSA 643 644@emph{Target Xtensa options:} 645 [@b{--[no-]text-section-literals}] [@b{--[no-]auto-litpools}] 646 [@b{--[no-]absolute-literals}] 647 [@b{--[no-]target-align}] [@b{--[no-]longcalls}] 648 [@b{--[no-]transform}] 649 [@b{--rename-section} @var{oldname}=@var{newname}] 650 [@b{--[no-]trampolines}] 651 [@b{--abi-windowed}|@b{--abi-call0}] 652@end ifset 653@ifset Z80 654 655@emph{Target Z80 options:} 656 [@b{-march=@var{CPU}@var{[-EXT]}@var{[+EXT]}}] 657 [@b{-local-prefix=}@var{PREFIX}] 658 [@b{-colonless}] 659 [@b{-sdcc}] 660 [@b{-fp-s=}@var{FORMAT}] 661 [@b{-fp-d=}@var{FORMAT}] 662@end ifset 663@ifset Z8000 664 665@c Z8000 has no machine-dependent assembler options 666@end ifset 667 668@c man end 669@end smallexample 670 671@c man begin OPTIONS 672 673@table @gcctabopt 674@include at-file.texi 675 676@item -a[cdghilmns] 677Turn on listings, in any of a variety of ways: 678 679@table @gcctabopt 680@item -ac 681omit false conditionals 682 683@item -ad 684omit debugging directives 685 686@item -ag 687include general information, like @value{AS} version and options passed 688 689@item -ah 690include high-level source 691 692@item -al 693include assembly 694 695@item -ali 696include assembly with ginsn 697 698@item -am 699include macro expansions 700 701@item -an 702omit forms processing 703 704@item -as 705include symbols 706 707@item =file 708set the name of the listing file 709@end table 710 711You may combine these options; for example, use @samp{-aln} for assembly 712listing without forms processing. The @samp{=file} option, if used, must be 713the last one. By itself, @samp{-a} defaults to @samp{-ahls}. 714 715@item --alternate 716Begin in alternate macro mode. 717@ifclear man 718@xref{Altmacro,,@code{.altmacro}}. 719@end ifclear 720 721@item --compress-debug-sections 722Compress DWARF debug sections using zlib with SHF_COMPRESSED from the 723ELF ABI. The resulting object file may not be compatible with older 724linkers and object file utilities. Note if compression would make a 725given section @emph{larger} then it is not compressed. 726 727@ifset ELF 728@cindex @samp{--compress-debug-sections=} option 729@item --compress-debug-sections=none 730@itemx --compress-debug-sections=zlib 731@itemx --compress-debug-sections=zlib-gnu 732@itemx --compress-debug-sections=zlib-gabi 733@itemx --compress-debug-sections=zstd 734These options control how DWARF debug sections are compressed. 735@option{--compress-debug-sections=none} is equivalent to 736@option{--nocompress-debug-sections}. 737@option{--compress-debug-sections=zlib} and 738@option{--compress-debug-sections=zlib-gabi} are equivalent to 739@option{--compress-debug-sections}. 740@option{--compress-debug-sections=zlib-gnu} compresses DWARF debug sections 741using the obsoleted zlib-gnu format. The debug sections are renamed to begin 742with @samp{.zdebug}. 743@option{--compress-debug-sections=zstd} compresses DWARF debug 744sections using zstd. Note - if compression would actually make a section 745@emph{larger}, then it is not compressed nor renamed. 746 747@end ifset 748 749@item --nocompress-debug-sections 750Do not compress DWARF debug sections. This is usually the default for all 751targets except the x86/x86_64, but a configure time option can be used to 752override this. 753 754@item -D 755Enable debugging in target specific backends, if supported. Otherwise ignored. 756Even if ignored, this option is accepted for script compatibility with calls to 757other assemblers. 758 759@item --debug-prefix-map @var{old}=@var{new} 760When assembling files in directory @file{@var{old}}, record debugging 761information describing them as in @file{@var{new}} instead. 762 763@item --defsym @var{sym}=@var{value} 764Define the symbol @var{sym} to be @var{value} before assembling the input file. 765@var{value} must be an integer constant. As in C, a leading @samp{0x} 766indicates a hexadecimal value, and a leading @samp{0} indicates an octal 767value. The value of the symbol can be overridden inside a source file via the 768use of a @code{.set} pseudo-op. 769 770@item --dump-config 771Displays how the assembler is configured and then exits. 772 773@ifset ELF 774@item --elf-stt-common=no 775@itemx --elf-stt-common=yes 776These options control whether the ELF assembler should generate common 777symbols with the @code{STT_COMMON} type. The default can be controlled 778by a configure option @option{--enable-elf-stt-common}. 779@end ifset 780 781@item --emulation=@var{name} 782If the assembler is configured to support multiple different target 783configurations then this option can be used to select the desired form. 784 785@item -f 786``fast''---skip whitespace and comment preprocessing (assume source is 787compiler output). 788 789@item -g 790@itemx --gen-debug 791Generate debugging information for each assembler source line using whichever 792debug format is preferred by the target. This currently means either STABS, 793ECOFF or DWARF2. When the debug format is DWARF then a @code{.debug_info} and 794@code{.debug_line} section is only emitted when the assembly file doesn't 795generate one itself. 796 797@item --gstabs 798Generate stabs debugging information for each assembler line. This 799may help debugging assembler code, if the debugger can handle it. 800 801@item --gstabs+ 802Generate stabs debugging information for each assembler line, with GNU 803extensions that probably only gdb can handle, and that could make other 804debuggers crash or refuse to read your program. This 805may help debugging assembler code. Currently the only GNU extension is 806the location of the current working directory at assembling time. 807 808@item --gdwarf-2 809Generate DWARF2 debugging information for each assembler line. This 810may help debugging assembler code, if the debugger can handle it. Note---this 811option is only supported by some targets, not all of them. 812 813@item --gdwarf-3 814This option is the same as the @option{--gdwarf-2} option, except that it 815allows for the possibility of the generation of extra debug information as per 816version 3 of the DWARF specification. Note - enabling this option does not 817guarantee the generation of any extra information, the choice to do so is on a 818per target basis. 819 820@item --gdwarf-4 821This option is the same as the @option{--gdwarf-2} option, except that it 822allows for the possibility of the generation of extra debug information as per 823version 4 of the DWARF specification. Note - enabling this option does not 824guarantee the generation of any extra information, the choice to do so is on a 825per target basis. 826 827@item --gdwarf-5 828This option is the same as the @option{--gdwarf-2} option, except that it 829allows for the possibility of the generation of extra debug information as per 830version 5 of the DWARF specification. Note - enabling this option does not 831guarantee the generation of any extra information, the choice to do so is on a 832per target basis. 833 834@item --gdwarf-sections 835Instead of creating a .debug_line section, create a series of 836.debug_line.@var{foo} sections where @var{foo} is the name of the 837corresponding code section. For example a code section called @var{.text.func} 838will have its dwarf line number information placed into a section called 839@var{.debug_line.text.func}. If the code section is just called @var{.text} 840then debug line section will still be called just @var{.debug_line} without any 841suffix. 842 843@item --gdwarf-cie-version=@var{version} 844Control which version of DWARF Common Information Entries (CIEs) are produced. 845When this flag is not specified the default is version 1, though some targets 846can modify this default. Other possible values for @var{version} are 3 or 4. 847 848@ifset ELF 849@item --generate-missing-build-notes=yes 850@itemx --generate-missing-build-notes=no 851These options control whether the ELF assembler should generate GNU Build 852attribute notes if none are present in the input sources. 853The default can be controlled by the @option{--enable-generate-build-notes} 854configure option. 855 856@item --gsframe 857@itemx --gsframe 858Create @var{.sframe} section from CFI directives. 859 860@end ifset 861 862@item --hash-size @var{N} 863Ignored. Supported for command line compatibility with other assemblers. 864 865@item --help 866Print a summary of the command-line options and exit. 867 868@item --target-help 869Print a summary of all target specific options and exit. 870 871@item -I @var{dir} 872Add directory @var{dir} to the search list for @code{.include} directives. 873 874@item -J 875Don't warn about signed overflow. 876 877@item -K 878@ifclear DIFF-TBL-KLUGE 879This option is accepted but has no effect on the @value{TARGET} family. 880@end ifclear 881@ifset DIFF-TBL-KLUGE 882Issue warnings when difference tables altered for long displacements. 883@end ifset 884 885@item -L 886@itemx --keep-locals 887Keep (in the symbol table) local symbols. These symbols start with 888system-specific local label prefixes, typically @samp{.L} for ELF systems 889or @samp{L} for traditional a.out systems. 890@ifclear man 891@xref{Symbol Names}. 892@end ifclear 893 894@item --listing-lhs-width=@var{number} 895Set the maximum width, in words, of the output data column for an assembler 896listing to @var{number}. 897 898@item --listing-lhs-width2=@var{number} 899Set the maximum width, in words, of the output data column for continuation 900lines in an assembler listing to @var{number}. 901 902@item --listing-rhs-width=@var{number} 903Set the maximum width of an input source line, as displayed in a listing, to 904@var{number} bytes. 905 906@item --listing-cont-lines=@var{number} 907Set the maximum number of lines printed in a listing for a single line of input 908to @var{number} + 1. 909 910@item --multibyte-handling=allow 911@itemx --multibyte-handling=warn 912@itemx --multibyte-handling=warn-sym-only 913@itemx --multibyte-handling=warn_sym_only 914Controls how the assembler handles multibyte characters in the input. The 915default (which can be restored by using the @option{allow} argument) is to 916allow such characters without complaint. Using the @option{warn} argument will 917make the assembler generate a warning message whenever any multibyte character 918is encountered. Using the @option{warn-sym-only} argument will only cause a 919warning to be generated when a symbol is defined with a name that contains 920multibyte characters. (References to undefined symbols will not generate a 921warning). 922 923@item --no-pad-sections 924Stop the assembler for padding the ends of output sections to the alignment 925of that section. The default is to pad the sections, but this can waste space 926which might be needed on targets which have tight memory constraints. 927 928@item -o @var{objfile} 929Name the object-file output from @command{@value{AS}} @var{objfile}. 930 931@item -R 932Fold the data section into the text section. 933 934@item --reduce-memory-overheads 935Ignored. Supported for compatibility with tools that apss the same option to 936both the assembler and the linker. 937 938@ifset ELF 939@item --scfi=experimental 940This option controls whether the assembler should synthesize CFI for 941hand-written input. If the input already contains some synthesizable CFI 942directives, the assembler ignores them and emits a warning. Note that 943@code{--scfi=experimental} is not intended to be used for compiler-generated 944code, including inline assembly. This experimental support is work in 945progress. Only System V AMD64 ABI is supported. 946 947Each input function in assembly must begin with the @code{.type} directive, and 948should ideally be closed off using a @code{.size} directive. When using SCFI, 949each @code{.type} directive prompts GAS to start a new FDE (a.k.a., Function 950Descriptor Entry). This implies that with each @code{.type} directive, a 951previous block of instructions, if any, is finalised as a distinct FDE. 952 953@item --sectname-subst 954Honor substitution sequences in section names. 955@ifclear man 956@xref{Section Name Substitutions,,@code{.section @var{name}}}. 957@end ifclear 958 959@item --size-check=error 960@itemx --size-check=warning 961Issue an error or warning for invalid ELF .size directive. 962@end ifset 963 964@item --statistics 965Print the maximum space (in bytes) and total time (in seconds) used by 966assembly. 967 968@item --strip-local-absolute 969Remove local absolute symbols from the outgoing symbol table. 970 971@item -v 972@itemx -version 973Print the @command{as} version. 974 975@item --version 976Print the @command{as} version and exit. 977 978@item -W 979@itemx --no-warn 980Suppress warning messages. 981 982@item --fatal-warnings 983Treat warnings as errors. 984 985@item --warn 986Don't suppress warning messages or treat them as errors. 987 988@item -w 989Ignored. 990 991@item -x 992Ignored. 993 994@item -Z 995Generate an object file even after errors. 996 997@item -- | @var{files} @dots{} 998Standard input, or source files to assemble. 999 1000@end table 1001@c man end 1002 1003@ifset AARCH64 1004 1005@ifclear man 1006@xref{AArch64 Options}, for the options available when @value{AS} is configured 1007for the 64-bit mode of the ARM Architecture (AArch64). 1008@end ifclear 1009 1010@ifset man 1011@c man begin OPTIONS 1012The following options are available when @value{AS} is configured for the 101364-bit mode of the ARM Architecture (AArch64). 1014@c man end 1015@c man begin INCLUDE 1016@include c-aarch64.texi 1017@c ended inside the included file 1018@end ifset 1019 1020@end ifset 1021 1022@ifset ALPHA 1023 1024@ifclear man 1025@xref{Alpha Options}, for the options available when @value{AS} is configured 1026for an Alpha processor. 1027@end ifclear 1028 1029@ifset man 1030@c man begin OPTIONS 1031The following options are available when @value{AS} is configured for an Alpha 1032processor. 1033@c man end 1034@c man begin INCLUDE 1035@include c-alpha.texi 1036@c ended inside the included file 1037@end ifset 1038 1039@end ifset 1040 1041@c man begin OPTIONS 1042@ifset ARC 1043The following options are available when @value{AS} is configured for an ARC 1044processor. 1045 1046@table @gcctabopt 1047@item -mcpu=@var{cpu} 1048This option selects the core processor variant. 1049@item -EB | -EL 1050Select either big-endian (-EB) or little-endian (-EL) output. 1051@item -mcode-density 1052Enable Code Density extension instructions. 1053@end table 1054@end ifset 1055 1056@ifset ARM 1057The following options are available when @value{AS} is configured for the ARM 1058processor family. 1059 1060@table @gcctabopt 1061@item -mcpu=@var{processor}[+@var{extension}@dots{}] 1062Specify which ARM processor variant is the target. 1063@item -march=@var{architecture}[+@var{extension}@dots{}] 1064Specify which ARM architecture variant is used by the target. 1065@item -mfpu=@var{floating-point-format} 1066Select which Floating Point architecture is the target. 1067@item -mfloat-abi=@var{abi} 1068Select which floating point ABI is in use. 1069@item -mthumb 1070Enable Thumb only instruction decoding. 1071@item -mapcs-32 | -mapcs-26 | -mapcs-float | -mapcs-reentrant 1072Select which procedure calling convention is in use. 1073@item -EB | -EL 1074Select either big-endian (-EB) or little-endian (-EL) output. 1075@item -mthumb-interwork 1076Specify that the code has been generated with interworking between Thumb and 1077ARM code in mind. 1078@item -mccs 1079Turns on CodeComposer Studio assembly syntax compatibility mode. 1080@item -k 1081Specify that PIC code has been generated. 1082@end table 1083@end ifset 1084@c man end 1085 1086@ifset Blackfin 1087 1088@ifclear man 1089@xref{Blackfin Options}, for the options available when @value{AS} is 1090configured for the Blackfin processor family. 1091@end ifclear 1092 1093@ifset man 1094@c man begin OPTIONS 1095The following options are available when @value{AS} is configured for 1096the Blackfin processor family. 1097@c man end 1098@c man begin INCLUDE 1099@include c-bfin.texi 1100@c ended inside the included file 1101@end ifset 1102 1103@end ifset 1104 1105@ifset BPF 1106 1107@ifclear man 1108@xref{BPF Options}, for the options available when @value{AS} is 1109configured for the Linux kernel BPF processor family. 1110@end ifclear 1111 1112@ifset man 1113@c man begin OPTIONS 1114The following options are available when @value{AS} is configured for 1115the Linux kernel BPF processor family. 1116@c man end 1117@c man begin INCLUDE 1118@include c-bpf.texi 1119@c ended inside the included file 1120@end ifset 1121 1122@end ifset 1123 1124@c man begin OPTIONS 1125@ifset CRIS 1126See the info pages for documentation of the CRIS-specific options. 1127@end ifset 1128 1129@ifset CSKY 1130 1131@ifclear man 1132@xref{C-SKY Options}, for the options available when @value{AS} is 1133configured for the C-SKY processor family. 1134@end ifclear 1135 1136@ifset man 1137@c man begin OPTIONS 1138The following options are available when @value{AS} is configured for 1139the C-SKY processor family. 1140@c man end 1141@c man begin INCLUDE 1142@include c-csky.texi 1143@c ended inside the included file 1144@end ifset 1145 1146@end ifset 1147 1148@ifset D10V 1149The following options are available when @value{AS} is configured for 1150a D10V processor. 1151@table @gcctabopt 1152@cindex D10V optimization 1153@cindex optimization, D10V 1154@item -O 1155Optimize output by parallelizing instructions. 1156@end table 1157@end ifset 1158 1159@ifset D30V 1160The following options are available when @value{AS} is configured for a D30V 1161processor. 1162@table @gcctabopt 1163@cindex D30V optimization 1164@cindex optimization, D30V 1165@item -O 1166Optimize output by parallelizing instructions. 1167 1168@cindex D30V nops 1169@item -n 1170Warn when nops are generated. 1171 1172@cindex D30V nops after 32-bit multiply 1173@item -N 1174Warn when a nop after a 32-bit multiply instruction is generated. 1175@end table 1176@end ifset 1177@c man end 1178 1179@ifset EPIPHANY 1180The following options are available when @value{AS} is configured for the 1181Adapteva EPIPHANY series. 1182 1183@ifclear man 1184@xref{Epiphany Options}, for the options available when @value{AS} is 1185configured for an Epiphany processor. 1186@end ifclear 1187 1188@ifset man 1189@c man begin OPTIONS 1190The following options are available when @value{AS} is configured for 1191an Epiphany processor. 1192@c man end 1193@c man begin INCLUDE 1194@include c-epiphany.texi 1195@c ended inside the included file 1196@end ifset 1197 1198@end ifset 1199 1200@ifset H8300 1201 1202@ifclear man 1203@xref{H8/300 Options}, for the options available when @value{AS} is configured 1204for an H8/300 processor. 1205@end ifclear 1206 1207@ifset man 1208@c man begin OPTIONS 1209The following options are available when @value{AS} is configured for an H8/300 1210processor. 1211@c man end 1212@c man begin INCLUDE 1213@include c-h8300.texi 1214@c ended inside the included file 1215@end ifset 1216 1217@end ifset 1218 1219@ifset I80386 1220 1221@ifclear man 1222@xref{i386-Options}, for the options available when @value{AS} is 1223configured for an i386 processor. 1224@end ifclear 1225 1226@ifset man 1227@c man begin OPTIONS 1228The following options are available when @value{AS} is configured for 1229an i386 processor. 1230@c man end 1231@c man begin INCLUDE 1232@include c-i386.texi 1233@c ended inside the included file 1234@end ifset 1235 1236@end ifset 1237 1238@c man begin OPTIONS 1239@ifset IP2K 1240The following options are available when @value{AS} is configured for the 1241Ubicom IP2K series. 1242 1243@table @gcctabopt 1244 1245@item -mip2022ext 1246Specifies that the extended IP2022 instructions are allowed. 1247 1248@item -mip2022 1249Restores the default behaviour, which restricts the permitted instructions to 1250just the basic IP2022 ones. 1251 1252@end table 1253@end ifset 1254 1255@ifset M32C 1256The following options are available when @value{AS} is configured for the 1257Renesas M32C and M16C processors. 1258 1259@table @gcctabopt 1260 1261@item -m32c 1262Assemble M32C instructions. 1263 1264@item -m16c 1265Assemble M16C instructions (the default). 1266 1267@item -relax 1268Enable support for link-time relaxations. 1269 1270@item -h-tick-hex 1271Support H'00 style hex constants in addition to 0x00 style. 1272 1273@end table 1274@end ifset 1275 1276@ifset M32R 1277The following options are available when @value{AS} is configured for the 1278Renesas M32R (formerly Mitsubishi M32R) series. 1279 1280@table @gcctabopt 1281 1282@item --m32rx 1283Specify which processor in the M32R family is the target. The default 1284is normally the M32R, but this option changes it to the M32RX. 1285 1286@item --warn-explicit-parallel-conflicts or --Wp 1287Produce warning messages when questionable parallel constructs are 1288encountered. 1289 1290@item --no-warn-explicit-parallel-conflicts or --Wnp 1291Do not produce warning messages when questionable parallel constructs are 1292encountered. 1293 1294@end table 1295@end ifset 1296 1297@ifset M680X0 1298The following options are available when @value{AS} is configured for the 1299Motorola 68000 series. 1300 1301@table @gcctabopt 1302 1303@item -l 1304Shorten references to undefined symbols, to one word instead of two. 1305 1306@item -m68000 | -m68008 | -m68010 | -m68020 | -m68030 1307@itemx | -m68040 | -m68060 | -m68302 | -m68331 | -m68332 1308@itemx | -m68333 | -m68340 | -mcpu32 | -m5200 1309Specify what processor in the 68000 family is the target. The default 1310is normally the 68020, but this can be changed at configuration time. 1311 1312@item -m68881 | -m68882 | -mno-68881 | -mno-68882 1313The target machine does (or does not) have a floating-point coprocessor. 1314The default is to assume a coprocessor for 68020, 68030, and cpu32. Although 1315the basic 68000 is not compatible with the 68881, a combination of the 1316two can be specified, since it's possible to do emulation of the 1317coprocessor instructions with the main processor. 1318 1319@item -m68851 | -mno-68851 1320The target machine does (or does not) have a memory-management 1321unit coprocessor. The default is to assume an MMU for 68020 and up. 1322 1323@end table 1324@end ifset 1325 1326@ifset NIOSII 1327 1328@ifclear man 1329@xref{Nios II Options}, for the options available when @value{AS} is configured 1330for an Altera Nios II processor. 1331@end ifclear 1332 1333@ifset man 1334@c man begin OPTIONS 1335The following options are available when @value{AS} is configured for an 1336Altera Nios II processor. 1337@c man end 1338@c man begin INCLUDE 1339@include c-nios2.texi 1340@c ended inside the included file 1341@end ifset 1342@end ifset 1343 1344@ifset PDP11 1345 1346For details about the PDP-11 machine dependent features options, 1347see @ref{PDP-11-Options}. 1348 1349@table @gcctabopt 1350@item -mpic | -mno-pic 1351Generate position-independent (or position-dependent) code. The 1352default is @option{-mpic}. 1353 1354@item -mall 1355@itemx -mall-extensions 1356Enable all instruction set extensions. This is the default. 1357 1358@item -mno-extensions 1359Disable all instruction set extensions. 1360 1361@item -m@var{extension} | -mno-@var{extension} 1362Enable (or disable) a particular instruction set extension. 1363 1364@item -m@var{cpu} 1365Enable the instruction set extensions supported by a particular CPU, and 1366disable all other extensions. 1367 1368@item -m@var{machine} 1369Enable the instruction set extensions supported by a particular machine 1370model, and disable all other extensions. 1371@end table 1372 1373@end ifset 1374 1375@ifset PJ 1376The following options are available when @value{AS} is configured for 1377a picoJava processor. 1378 1379@table @gcctabopt 1380 1381@cindex PJ endianness 1382@cindex endianness, PJ 1383@cindex big endian output, PJ 1384@item -mb 1385Generate ``big endian'' format output. 1386 1387@cindex little endian output, PJ 1388@item -ml 1389Generate ``little endian'' format output. 1390 1391@end table 1392@end ifset 1393 1394@ifset PRU 1395 1396@ifclear man 1397@xref{PRU Options}, for the options available when @value{AS} is configured 1398for a PRU processor. 1399@end ifclear 1400 1401@ifset man 1402@c man begin OPTIONS 1403The following options are available when @value{AS} is configured for a 1404PRU processor. 1405@c man end 1406@c man begin INCLUDE 1407@include c-pru.texi 1408@c ended inside the included file 1409@end ifset 1410@end ifset 1411 1412@ifset M68HC11 1413The following options are available when @value{AS} is configured for the 1414Motorola 68HC11 or 68HC12 series. 1415 1416@table @gcctabopt 1417 1418@item -m68hc11 | -m68hc12 | -m68hcs12 | -mm9s12x | -mm9s12xg 1419Specify what processor is the target. The default is 1420defined by the configuration option when building the assembler. 1421 1422@item --xgate-ramoffset 1423Instruct the linker to offset RAM addresses from S12X address space into 1424XGATE address space. 1425 1426@item -mshort 1427Specify to use the 16-bit integer ABI. 1428 1429@item -mlong 1430Specify to use the 32-bit integer ABI. 1431 1432@item -mshort-double 1433Specify to use the 32-bit double ABI. 1434 1435@item -mlong-double 1436Specify to use the 64-bit double ABI. 1437 1438@item --force-long-branches 1439Relative branches are turned into absolute ones. This concerns 1440conditional branches, unconditional branches and branches to a 1441sub routine. 1442 1443@item -S | --short-branches 1444Do not turn relative branches into absolute ones 1445when the offset is out of range. 1446 1447@item --strict-direct-mode 1448Do not turn the direct addressing mode into extended addressing mode 1449when the instruction does not support direct addressing mode. 1450 1451@item --print-insn-syntax 1452Print the syntax of instruction in case of error. 1453 1454@item --print-opcodes 1455Print the list of instructions with syntax and then exit. 1456 1457@item --generate-example 1458Print an example of instruction for each possible instruction and then exit. 1459This option is only useful for testing @command{@value{AS}}. 1460 1461@end table 1462@end ifset 1463 1464@ifset SPARC 1465The following options are available when @command{@value{AS}} is configured 1466for the SPARC architecture: 1467 1468@table @gcctabopt 1469@item -Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite 1470@itemx -Av8plus | -Av8plusa | -Av9 | -Av9a 1471Explicitly select a variant of the SPARC architecture. 1472 1473@samp{-Av8plus} and @samp{-Av8plusa} select a 32 bit environment. 1474@samp{-Av9} and @samp{-Av9a} select a 64 bit environment. 1475 1476@samp{-Av8plusa} and @samp{-Av9a} enable the SPARC V9 instruction set with 1477UltraSPARC extensions. 1478 1479@item -xarch=v8plus | -xarch=v8plusa 1480For compatibility with the Solaris v9 assembler. These options are 1481equivalent to -Av8plus and -Av8plusa, respectively. 1482 1483@item -bump 1484Warn when the assembler switches to another architecture. 1485@end table 1486@end ifset 1487 1488@ifset TIC54X 1489The following options are available when @value{AS} is configured for the 'c54x 1490architecture. 1491 1492@table @gcctabopt 1493@item -mfar-mode 1494Enable extended addressing mode. All addresses and relocations will assume 1495extended addressing (usually 23 bits). 1496@item -mcpu=@var{CPU_VERSION} 1497Sets the CPU version being compiled for. 1498@item -merrors-to-file @var{FILENAME} 1499Redirect error output to a file, for broken systems which don't support such 1500behaviour in the shell. 1501@end table 1502@end ifset 1503 1504@ifset MIPS 1505@c man begin OPTIONS 1506The following options are available when @value{AS} is configured for 1507a MIPS processor. 1508 1509@table @gcctabopt 1510@item -G @var{num} 1511This option sets the largest size of an object that can be referenced 1512implicitly with the @code{gp} register. It is only accepted for targets that 1513use ECOFF format, such as a DECstation running Ultrix. The default value is 8. 1514 1515@cindex MIPS endianness 1516@cindex endianness, MIPS 1517@cindex big endian output, MIPS 1518@item -EB 1519Generate ``big endian'' format output. 1520 1521@cindex little endian output, MIPS 1522@item -EL 1523Generate ``little endian'' format output. 1524 1525@cindex MIPS ISA 1526@item -mips1 1527@itemx -mips2 1528@itemx -mips3 1529@itemx -mips4 1530@itemx -mips5 1531@itemx -mips32 1532@itemx -mips32r2 1533@itemx -mips32r3 1534@itemx -mips32r5 1535@itemx -mips32r6 1536@itemx -mips64 1537@itemx -mips64r2 1538@itemx -mips64r3 1539@itemx -mips64r5 1540@itemx -mips64r6 1541Generate code for a particular MIPS Instruction Set Architecture level. 1542@samp{-mips1} is an alias for @samp{-march=r3000}, @samp{-mips2} is an 1543alias for @samp{-march=r6000}, @samp{-mips3} is an alias for 1544@samp{-march=r4000} and @samp{-mips4} is an alias for @samp{-march=r8000}. 1545@samp{-mips5}, @samp{-mips32}, @samp{-mips32r2}, @samp{-mips32r3}, 1546@samp{-mips32r5}, @samp{-mips32r6}, @samp{-mips64}, @samp{-mips64r2}, 1547@samp{-mips64r3}, @samp{-mips64r5}, and @samp{-mips64r6} correspond to generic 1548MIPS V, MIPS32, MIPS32 Release 2, MIPS32 Release 3, MIPS32 Release 5, MIPS32 1549Release 6, MIPS64, MIPS64 Release 2, MIPS64 Release 3, MIPS64 Release 5, and 1550MIPS64 Release 6 ISA processors, respectively. 1551 1552@item -march=@var{cpu} 1553Generate code for a particular MIPS CPU. 1554 1555@item -mtune=@var{cpu} 1556Schedule and tune for a particular MIPS CPU. 1557 1558@item -mfix7000 1559@itemx -mno-fix7000 1560Cause nops to be inserted if the read of the destination register 1561of an mfhi or mflo instruction occurs in the following two instructions. 1562 1563@item -mfix-rm7000 1564@itemx -mno-fix-rm7000 1565Cause nops to be inserted if a dmult or dmultu instruction is 1566followed by a load instruction. 1567 1568@item -mfix-r5900 1569@itemx -mno-fix-r5900 1570Do not attempt to schedule the preceding instruction into the delay slot 1571of a branch instruction placed at the end of a short loop of six 1572instructions or fewer and always schedule a @code{nop} instruction there 1573instead. The short loop bug under certain conditions causes loops to 1574execute only once or twice, due to a hardware bug in the R5900 chip. 1575 1576@item -mdebug 1577@itemx -no-mdebug 1578Cause stabs-style debugging output to go into an ECOFF-style .mdebug 1579section instead of the standard ELF .stabs sections. 1580 1581@item -mpdr 1582@itemx -mno-pdr 1583Control generation of @code{.pdr} sections. 1584 1585@item -mgp32 1586@itemx -mfp32 1587The register sizes are normally inferred from the ISA and ABI, but these 1588flags force a certain group of registers to be treated as 32 bits wide at 1589all times. @samp{-mgp32} controls the size of general-purpose registers 1590and @samp{-mfp32} controls the size of floating-point registers. 1591 1592@item -mgp64 1593@itemx -mfp64 1594The register sizes are normally inferred from the ISA and ABI, but these 1595flags force a certain group of registers to be treated as 64 bits wide at 1596all times. @samp{-mgp64} controls the size of general-purpose registers 1597and @samp{-mfp64} controls the size of floating-point registers. 1598 1599@item -mfpxx 1600The register sizes are normally inferred from the ISA and ABI, but using 1601this flag in combination with @samp{-mabi=32} enables an ABI variant 1602which will operate correctly with floating-point registers which are 160332 or 64 bits wide. 1604 1605@item -modd-spreg 1606@itemx -mno-odd-spreg 1607Enable use of floating-point operations on odd-numbered single-precision 1608registers when supported by the ISA. @samp{-mfpxx} implies 1609@samp{-mno-odd-spreg}, otherwise the default is @samp{-modd-spreg}. 1610 1611@item -mips16 1612@itemx -no-mips16 1613Generate code for the MIPS 16 processor. This is equivalent to putting 1614@code{.module mips16} at the start of the assembly file. @samp{-no-mips16} 1615turns off this option. 1616 1617@item -mmips16e2 1618@itemx -mno-mips16e2 1619Enable the use of MIPS16e2 instructions in MIPS16 mode. This is equivalent 1620to putting @code{.module mips16e2} at the start of the assembly file. 1621@samp{-mno-mips16e2} turns off this option. 1622 1623@item -mmicromips 1624@itemx -mno-micromips 1625Generate code for the microMIPS processor. This is equivalent to putting 1626@code{.module micromips} at the start of the assembly file. 1627@samp{-mno-micromips} turns off this option. This is equivalent to putting 1628@code{.module nomicromips} at the start of the assembly file. 1629 1630@item -msmartmips 1631@itemx -mno-smartmips 1632Enables the SmartMIPS extension to the MIPS32 instruction set. This is 1633equivalent to putting @code{.module smartmips} at the start of the assembly 1634file. @samp{-mno-smartmips} turns off this option. 1635 1636@item -mips3d 1637@itemx -no-mips3d 1638Generate code for the MIPS-3D Application Specific Extension. 1639This tells the assembler to accept MIPS-3D instructions. 1640@samp{-no-mips3d} turns off this option. 1641 1642@item -mdmx 1643@itemx -no-mdmx 1644Generate code for the MDMX Application Specific Extension. 1645This tells the assembler to accept MDMX instructions. 1646@samp{-no-mdmx} turns off this option. 1647 1648@item -mdsp 1649@itemx -mno-dsp 1650Generate code for the DSP Release 1 Application Specific Extension. 1651This tells the assembler to accept DSP Release 1 instructions. 1652@samp{-mno-dsp} turns off this option. 1653 1654@item -mdspr2 1655@itemx -mno-dspr2 1656Generate code for the DSP Release 2 Application Specific Extension. 1657This option implies @samp{-mdsp}. 1658This tells the assembler to accept DSP Release 2 instructions. 1659@samp{-mno-dspr2} turns off this option. 1660 1661@item -mdspr3 1662@itemx -mno-dspr3 1663Generate code for the DSP Release 3 Application Specific Extension. 1664This option implies @samp{-mdsp} and @samp{-mdspr2}. 1665This tells the assembler to accept DSP Release 3 instructions. 1666@samp{-mno-dspr3} turns off this option. 1667 1668@item -mmsa 1669@itemx -mno-msa 1670Generate code for the MIPS SIMD Architecture Extension. 1671This tells the assembler to accept MSA instructions. 1672@samp{-mno-msa} turns off this option. 1673 1674@item -mxpa 1675@itemx -mno-xpa 1676Generate code for the MIPS eXtended Physical Address (XPA) Extension. 1677This tells the assembler to accept XPA instructions. 1678@samp{-mno-xpa} turns off this option. 1679 1680@item -mmt 1681@itemx -mno-mt 1682Generate code for the MT Application Specific Extension. 1683This tells the assembler to accept MT instructions. 1684@samp{-mno-mt} turns off this option. 1685 1686@item -mmcu 1687@itemx -mno-mcu 1688Generate code for the MCU Application Specific Extension. 1689This tells the assembler to accept MCU instructions. 1690@samp{-mno-mcu} turns off this option. 1691 1692@item -mcrc 1693@itemx -mno-crc 1694Generate code for the MIPS cyclic redundancy check (CRC) Application 1695Specific Extension. This tells the assembler to accept CRC instructions. 1696@samp{-mno-crc} turns off this option. 1697 1698@item -mginv 1699@itemx -mno-ginv 1700Generate code for the Global INValidate (GINV) Application Specific 1701Extension. This tells the assembler to accept GINV instructions. 1702@samp{-mno-ginv} turns off this option. 1703 1704@item -mloongson-mmi 1705@itemx -mno-loongson-mmi 1706Generate code for the Loongson MultiMedia extensions Instructions (MMI) 1707Application Specific Extension. This tells the assembler to accept MMI 1708instructions. 1709@samp{-mno-loongson-mmi} turns off this option. 1710 1711@item -mloongson-cam 1712@itemx -mno-loongson-cam 1713Generate code for the Loongson Content Address Memory (CAM) instructions. 1714This tells the assembler to accept Loongson CAM instructions. 1715@samp{-mno-loongson-cam} turns off this option. 1716 1717@item -mloongson-ext 1718@itemx -mno-loongson-ext 1719Generate code for the Loongson EXTensions (EXT) instructions. 1720This tells the assembler to accept Loongson EXT instructions. 1721@samp{-mno-loongson-ext} turns off this option. 1722 1723@item -mloongson-ext2 1724@itemx -mno-loongson-ext2 1725Generate code for the Loongson EXTensions R2 (EXT2) instructions. 1726This option implies @samp{-mloongson-ext}. 1727This tells the assembler to accept Loongson EXT2 instructions. 1728@samp{-mno-loongson-ext2} turns off this option. 1729 1730@item -minsn32 1731@itemx -mno-insn32 1732Only use 32-bit instruction encodings when generating code for the 1733microMIPS processor. This option inhibits the use of any 16-bit 1734instructions. This is equivalent to putting @code{.set insn32} at 1735the start of the assembly file. @samp{-mno-insn32} turns off this 1736option. This is equivalent to putting @code{.set noinsn32} at the 1737start of the assembly file. By default @samp{-mno-insn32} is 1738selected, allowing all instructions to be used. 1739 1740@item --construct-floats 1741@itemx --no-construct-floats 1742The @samp{--no-construct-floats} option disables the construction of 1743double width floating point constants by loading the two halves of the 1744value into the two single width floating point registers that make up 1745the double width register. By default @samp{--construct-floats} is 1746selected, allowing construction of these floating point constants. 1747 1748@item --relax-branch 1749@itemx --no-relax-branch 1750The @samp{--relax-branch} option enables the relaxation of out-of-range 1751branches. By default @samp{--no-relax-branch} is selected, causing any 1752out-of-range branches to produce an error. 1753 1754@item -mignore-branch-isa 1755@itemx -mno-ignore-branch-isa 1756Ignore branch checks for invalid transitions between ISA modes. The 1757semantics of branches does not provide for an ISA mode switch, so in 1758most cases the ISA mode a branch has been encoded for has to be the 1759same as the ISA mode of the branch's target label. Therefore GAS has 1760checks implemented that verify in branch assembly that the two ISA 1761modes match. @samp{-mignore-branch-isa} disables these checks. By 1762default @samp{-mno-ignore-branch-isa} is selected, causing any invalid 1763branch requiring a transition between ISA modes to produce an error. 1764 1765@item -mnan=@var{encoding} 1766Select between the IEEE 754-2008 (@option{-mnan=2008}) or the legacy 1767(@option{-mnan=legacy}) NaN encoding format. The latter is the default. 1768 1769@cindex emulation 1770@item --emulation=@var{name} 1771This option was formerly used to switch between ELF and ECOFF output 1772on targets like IRIX 5 that supported both. MIPS ECOFF support was 1773removed in GAS 2.24, so the option now serves little purpose. 1774It is retained for backwards compatibility. 1775 1776The available configuration names are: @samp{mipself}, @samp{mipslelf} and 1777@samp{mipsbelf}. Choosing @samp{mipself} now has no effect, since the output 1778is always ELF. @samp{mipslelf} and @samp{mipsbelf} select little- and 1779big-endian output respectively, but @samp{-EL} and @samp{-EB} are now the 1780preferred options instead. 1781 1782@item -nocpp 1783@command{@value{AS}} ignores this option. It is accepted for compatibility with 1784the native tools. 1785 1786@item --trap 1787@itemx --no-trap 1788@itemx --break 1789@itemx --no-break 1790Control how to deal with multiplication overflow and division by zero. 1791@samp{--trap} or @samp{--no-break} (which are synonyms) take a trap exception 1792(and only work for Instruction Set Architecture level 2 and higher); 1793@samp{--break} or @samp{--no-trap} (also synonyms, and the default) take a 1794break exception. 1795 1796@item -n 1797When this option is used, @command{@value{AS}} will issue a warning every 1798time it generates a nop instruction from a macro. 1799@end table 1800@c man end 1801@end ifset 1802 1803@ifset MCORE 1804The following options are available when @value{AS} is configured for 1805an MCore processor. 1806 1807@table @gcctabopt 1808@item -jsri2bsr 1809@itemx -nojsri2bsr 1810Enable or disable the JSRI to BSR transformation. By default this is enabled. 1811The command-line option @samp{-nojsri2bsr} can be used to disable it. 1812 1813@item -sifilter 1814@itemx -nosifilter 1815Enable or disable the silicon filter behaviour. By default this is disabled. 1816The default can be overridden by the @samp{-sifilter} command-line option. 1817 1818@item -relax 1819Alter jump instructions for long displacements. 1820 1821@item -mcpu=[210|340] 1822Select the cpu type on the target hardware. This controls which instructions 1823can be assembled. 1824 1825@item -EB 1826Assemble for a big endian target. 1827 1828@item -EL 1829Assemble for a little endian target. 1830 1831@end table 1832@end ifset 1833@c man end 1834 1835@ifset LOONGARCH 1836 1837@ifclear man 1838@xref{LoongArch-Options}, for the options available when @value{AS} is configured 1839for a LoongArch processor. 1840@end ifclear 1841 1842@ifset man 1843@c man begin OPTIONS 1844The following options are available when @value{AS} is configured for a 1845LoongArch processor. 1846@c man end 1847@c man begin INCLUDE 1848@include c-loongarch.texi 1849@c ended inside the included file 1850@end ifset 1851 1852@end ifset 1853 1854@ifset METAG 1855 1856@ifclear man 1857@xref{Meta Options}, for the options available when @value{AS} is configured 1858for a Meta processor. 1859@end ifclear 1860 1861@ifset man 1862@c man begin OPTIONS 1863The following options are available when @value{AS} is configured for a 1864Meta processor. 1865@c man end 1866@c man begin INCLUDE 1867@include c-metag.texi 1868@c ended inside the included file 1869@end ifset 1870 1871@end ifset 1872 1873@c man begin OPTIONS 1874@ifset MMIX 1875See the info pages for documentation of the MMIX-specific options. 1876@end ifset 1877 1878@ifset NDS32 1879 1880@ifclear man 1881@xref{NDS32 Options}, for the options available when @value{AS} is configured 1882for a NDS32 processor. 1883@end ifclear 1884@c ended inside the included file 1885@end ifset 1886 1887@ifset man 1888@c man begin OPTIONS 1889The following options are available when @value{AS} is configured for a 1890NDS32 processor. 1891@c man end 1892@c man begin INCLUDE 1893@include c-nds32.texi 1894@c ended inside the included file 1895@end ifset 1896 1897@c man end 1898@ifset PPC 1899 1900@ifclear man 1901@xref{PowerPC-Opts}, for the options available when @value{AS} is configured 1902for a PowerPC processor. 1903@end ifclear 1904 1905@ifset man 1906@c man begin OPTIONS 1907The following options are available when @value{AS} is configured for a 1908PowerPC processor. 1909@c man end 1910@c man begin INCLUDE 1911@include c-ppc.texi 1912@c ended inside the included file 1913@end ifset 1914 1915@end ifset 1916 1917@ifset RISCV 1918 1919@ifclear man 1920@xref{RISC-V-Options}, for the options available when @value{AS} is configured 1921for a RISC-V processor. 1922@end ifclear 1923 1924@ifset man 1925@c man begin OPTIONS 1926The following options are available when @value{AS} is configured for a 1927RISC-V processor. 1928@c man end 1929@c man begin INCLUDE 1930@include c-riscv.texi 1931@c ended inside the included file 1932@end ifset 1933 1934@end ifset 1935 1936@c man begin OPTIONS 1937@ifset RX 1938See the info pages for documentation of the RX-specific options. 1939@end ifset 1940 1941@ifset S390 1942The following options are available when @value{AS} is configured for the s390 1943processor family. 1944 1945@table @gcctabopt 1946@item -m31 1947@itemx -m64 1948Select the word size, either 31/32 bits or 64 bits. 1949@item -mesa 1950@item -mzarch 1951Select the architecture mode, either the Enterprise System 1952Architecture (esa) or the z/Architecture mode (zarch). 1953@item -march=@var{processor} 1954Specify which s390 processor variant is the target, @samp{g5} (or 1955@samp{arch3}), @samp{g6}, @samp{z900} (or @samp{arch5}), @samp{z990} (or 1956@samp{arch6}), @samp{z9-109}, @samp{z9-ec} (or @samp{arch7}), @samp{z10} (or 1957@samp{arch8}), @samp{z196} (or @samp{arch9}), @samp{zEC12} (or @samp{arch10}), 1958@samp{z13} (or @samp{arch11}), @samp{z14} (or @samp{arch12}), @samp{z15} 1959(or @samp{arch13}), or @samp{z16} (or @samp{arch14}). 1960@item -mregnames 1961@itemx -mno-regnames 1962Allow or disallow symbolic names for registers. 1963@item -mwarn-areg-zero 1964Warn whenever the operand for a base or index register has been specified 1965but evaluates to zero. 1966@end table 1967@end ifset 1968@c man end 1969 1970@ifset TIC6X 1971 1972@ifclear man 1973@xref{TIC6X Options}, for the options available when @value{AS} is configured 1974for a TMS320C6000 processor. 1975@end ifclear 1976 1977@ifset man 1978@c man begin OPTIONS 1979The following options are available when @value{AS} is configured for a 1980TMS320C6000 processor. 1981@c man end 1982@c man begin INCLUDE 1983@include c-tic6x.texi 1984@c ended inside the included file 1985@end ifset 1986 1987@end ifset 1988 1989@ifset TILEGX 1990 1991@ifclear man 1992@xref{TILE-Gx Options}, for the options available when @value{AS} is configured 1993for a TILE-Gx processor. 1994@end ifclear 1995 1996@ifset man 1997@c man begin OPTIONS 1998The following options are available when @value{AS} is configured for a TILE-Gx 1999processor. 2000@c man end 2001@c man begin INCLUDE 2002@include c-tilegx.texi 2003@c ended inside the included file 2004@end ifset 2005 2006@end ifset 2007 2008@ifset VISIUM 2009 2010@ifclear man 2011@xref{Visium Options}, for the options available when @value{AS} is configured 2012for a Visium processor. 2013@end ifclear 2014 2015@ifset man 2016@c man begin OPTIONS 2017The following option is available when @value{AS} is configured for a Visium 2018processor. 2019@c man end 2020@c man begin INCLUDE 2021@include c-visium.texi 2022@c ended inside the included file 2023@end ifset 2024 2025@end ifset 2026 2027@ifset XTENSA 2028 2029@ifclear man 2030@xref{Xtensa Options}, for the options available when @value{AS} is configured 2031for an Xtensa processor. 2032@end ifclear 2033 2034@ifset man 2035@c man begin OPTIONS 2036The following options are available when @value{AS} is configured for an 2037Xtensa processor. 2038@c man end 2039@c man begin INCLUDE 2040@include c-xtensa.texi 2041@c ended inside the included file 2042@end ifset 2043 2044@end ifset 2045 2046@ifset Z80 2047 2048@ifclear man 2049@xref{Z80 Options}, for the options available when @value{AS} is configured 2050for an Z80 processor. 2051@end ifclear 2052 2053@ifset man 2054@c man begin OPTIONS 2055The following options are available when @value{AS} is configured for an 2056Z80 processor. 2057@c man end 2058@c man begin INCLUDE 2059@include c-z80.texi 2060@c ended inside the included file 2061@end ifset 2062 2063@end ifset 2064 2065@menu 2066* Manual:: Structure of this Manual 2067* GNU Assembler:: The GNU Assembler 2068* Object Formats:: Object File Formats 2069* Command Line:: Command Line 2070* Input Files:: Input Files 2071* Object:: Output (Object) File 2072* Errors:: Error and Warning Messages 2073@end menu 2074 2075@node Manual 2076@section Structure of this Manual 2077 2078@cindex manual, structure and purpose 2079This manual is intended to describe what you need to know to use 2080@sc{gnu} @command{@value{AS}}. We cover the syntax expected in source files, including 2081notation for symbols, constants, and expressions; the directives that 2082@command{@value{AS}} understands; and of course how to invoke @command{@value{AS}}. 2083 2084@ifclear GENERIC 2085We also cover special features in the @value{TARGET} 2086configuration of @command{@value{AS}}, including assembler directives. 2087@end ifclear 2088@ifset GENERIC 2089This manual also describes some of the machine-dependent features of 2090various flavors of the assembler. 2091@end ifset 2092 2093@cindex machine instructions (not covered) 2094On the other hand, this manual is @emph{not} intended as an introduction 2095to programming in assembly language---let alone programming in general! 2096In a similar vein, we make no attempt to introduce the machine 2097architecture; we do @emph{not} describe the instruction set, standard 2098mnemonics, registers or addressing modes that are standard to a 2099particular architecture. 2100@ifset GENERIC 2101You may want to consult the manufacturer's 2102machine architecture manual for this information. 2103@end ifset 2104@ifclear GENERIC 2105@ifset H8/300 2106For information on the H8/300 machine instruction set, see @cite{H8/300 2107Series Programming Manual}. For the H8/300H, see @cite{H8/300H Series 2108Programming Manual} (Renesas). 2109@end ifset 2110@ifset SH 2111For information on the Renesas (formerly Hitachi) / SuperH SH machine instruction set, 2112see @cite{SH-Microcomputer User's Manual} (Renesas) or 2113@cite{SH-4 32-bit CPU Core Architecture} (SuperH) and 2114@cite{SuperH (SH) 64-Bit RISC Series} (SuperH). 2115@end ifset 2116@ifset Z8000 2117For information on the Z8000 machine instruction set, see @cite{Z8000 CPU Technical Manual} 2118@end ifset 2119@end ifclear 2120 2121@c I think this is premature---doc@cygnus.com, 17jan1991 2122@ignore 2123Throughout this manual, we assume that you are running @dfn{GNU}, 2124the portable operating system from the @dfn{Free Software 2125Foundation, Inc.}. This restricts our attention to certain kinds of 2126computer (in particular, the kinds of computers that @sc{gnu} can run on); 2127once this assumption is granted examples and definitions need less 2128qualification. 2129 2130@command{@value{AS}} is part of a team of programs that turn a high-level 2131human-readable series of instructions into a low-level 2132computer-readable series of instructions. Different versions of 2133@command{@value{AS}} are used for different kinds of computer. 2134@end ignore 2135 2136@c There used to be a section "Terminology" here, which defined 2137@c "contents", "byte", "word", and "long". Defining "word" to any 2138@c particular size is confusing when the .word directive may generate 16 2139@c bits on one machine and 32 bits on another; in general, for the user 2140@c version of this manual, none of these terms seem essential to define. 2141@c They were used very little even in the former draft of the manual; 2142@c this draft makes an effort to avoid them (except in names of 2143@c directives). 2144 2145@node GNU Assembler 2146@section The GNU Assembler 2147 2148@c man begin DESCRIPTION 2149 2150@sc{gnu} @command{as} is really a family of assemblers. 2151@ifclear GENERIC 2152This manual describes @command{@value{AS}}, a member of that family which is 2153configured for the @value{TARGET} architectures. 2154@end ifclear 2155If you use (or have used) the @sc{gnu} assembler on one architecture, you 2156should find a fairly similar environment when you use it on another 2157architecture. Each version has much in common with the others, 2158including object file formats, most assembler directives (often called 2159@dfn{pseudo-ops}) and assembler syntax. 2160 2161@cindex purpose of @sc{gnu} assembler 2162@command{@value{AS}} is primarily intended to assemble the output of the 2163@sc{gnu} C compiler @code{@value{GCC}} for use by the linker 2164@code{@value{LD}}. Nevertheless, we've tried to make @command{@value{AS}} 2165assemble correctly everything that other assemblers for the same 2166machine would assemble. 2167@ifset VAX 2168Any exceptions are documented explicitly (@pxref{Machine Dependencies}). 2169@end ifset 2170@ifset M680X0 2171@c This remark should appear in generic version of manual; assumption 2172@c here is that generic version sets M680x0. 2173This doesn't mean @command{@value{AS}} always uses the same syntax as another 2174assembler for the same architecture; for example, we know of several 2175incompatible versions of 680x0 assembly language syntax. 2176@end ifset 2177 2178@c man end 2179 2180Unlike older assemblers, @command{@value{AS}} is designed to assemble a source 2181program in one pass of the source file. This has a subtle impact on the 2182@kbd{.org} directive (@pxref{Org,,@code{.org}}). 2183 2184@node Object Formats 2185@section Object File Formats 2186 2187@cindex object file format 2188The @sc{gnu} assembler can be configured to produce several alternative 2189object file formats. For the most part, this does not affect how you 2190write assembly language programs; but directives for debugging symbols 2191are typically different in different file formats. @xref{Symbol 2192Attributes,,Symbol Attributes}. 2193@ifclear GENERIC 2194@ifclear MULTI-OBJ 2195For the @value{TARGET} target, @command{@value{AS}} is configured to produce 2196@value{OBJ-NAME} format object files. 2197@end ifclear 2198@c The following should exhaust all configs that set MULTI-OBJ, ideally 2199@ifset HPPA 2200On the @value{TARGET}, @command{@value{AS}} can be configured to produce either 2201SOM or ELF format object files. 2202@end ifset 2203@end ifclear 2204 2205@node Command Line 2206@section Command Line 2207 2208@cindex command line conventions 2209 2210After the program name @command{@value{AS}}, the command line may contain 2211options and file names. Options may appear in any order, and may be 2212before, after, or between file names. The order of file names is 2213significant. 2214 2215@cindex standard input, as input file 2216@kindex -- 2217@file{--} (two hyphens) by itself names the standard input file 2218explicitly, as one of the files for @command{@value{AS}} to assemble. 2219 2220@cindex options, command line 2221Except for @samp{--} any command-line argument that begins with a 2222hyphen (@samp{-}) is an option. Each option changes the behavior of 2223@command{@value{AS}}. No option changes the way another option works. An 2224option is a @samp{-} followed by one or more letters; the case of 2225the letter is important. All options are optional. 2226 2227Some options expect exactly one file name to follow them. The file 2228name may either immediately follow the option's letter (compatible 2229with older assemblers) or it may be the next command argument (@sc{gnu} 2230standard). These two command lines are equivalent: 2231 2232@smallexample 2233@value{AS} -o my-object-file.o mumble.s 2234@value{AS} -omy-object-file.o mumble.s 2235@end smallexample 2236 2237@node Input Files 2238@section Input Files 2239 2240@cindex input 2241@cindex source program 2242@cindex files, input 2243We use the phrase @dfn{source program}, abbreviated @dfn{source}, to 2244describe the program input to one run of @command{@value{AS}}. The program may 2245be in one or more files; how the source is partitioned into files 2246doesn't change the meaning of the source. 2247 2248@c I added "con" prefix to "catenation" just to prove I can overcome my 2249@c APL training... doc@cygnus.com 2250The source program is a concatenation of the text in all the files, in the 2251order specified. 2252 2253@c man begin DESCRIPTION 2254Each time you run @command{@value{AS}} it assembles exactly one source 2255program. The source program is made up of one or more files. 2256(The standard input is also a file.) 2257 2258You give @command{@value{AS}} a command line that has zero or more input file 2259names. The input files are read (from left file name to right). A 2260command-line argument (in any position) that has no special meaning 2261is taken to be an input file name. 2262 2263If you give @command{@value{AS}} no file names it attempts to read one input file 2264from the @command{@value{AS}} standard input, which is normally your terminal. You 2265may have to type @key{ctl-D} to tell @command{@value{AS}} there is no more program 2266to assemble. 2267 2268Use @samp{--} if you need to explicitly name the standard input file 2269in your command line. 2270 2271If the source is empty, @command{@value{AS}} produces a small, empty object 2272file. 2273 2274@c man end 2275 2276@subheading Filenames and Line-numbers 2277 2278@cindex input file linenumbers 2279@cindex line numbers, in input files 2280There are two ways of locating a line in the input file (or files) and 2281either may be used in reporting error messages. One way refers to a line 2282number in a physical file; the other refers to a line number in a 2283``logical'' file. @xref{Errors, ,Error and Warning Messages}. 2284 2285@dfn{Physical files} are those files named in the command line given 2286to @command{@value{AS}}. 2287 2288@dfn{Logical files} are simply names declared explicitly by assembler 2289directives; they bear no relation to physical files. Logical file names help 2290error messages reflect the original source file, when @command{@value{AS}} source 2291is itself synthesized from other files. @command{@value{AS}} understands the 2292@samp{#} directives emitted by the @code{@value{GCC}} preprocessor. See also 2293@ref{File,,@code{.file}}. 2294 2295@node Object 2296@section Output (Object) File 2297 2298@cindex object file 2299@cindex output file 2300@kindex a.out 2301@kindex .o 2302Every time you run @command{@value{AS}} it produces an output file, which is 2303your assembly language program translated into numbers. This file 2304is the object file. Its default name is @code{a.out}. 2305You can give it another name by using the @option{-o} option. Conventionally, 2306object file names end with @file{.o}. The default name is used for historical 2307reasons: older assemblers were capable of assembling self-contained programs 2308directly into a runnable program. (For some formats, this isn't currently 2309possible, but it can be done for the @code{a.out} format.) 2310 2311@cindex linker 2312@kindex ld 2313The object file is meant for input to the linker @code{@value{LD}}. It contains 2314assembled program code, information to help @code{@value{LD}} integrate 2315the assembled program into a runnable file, and (optionally) symbolic 2316information for the debugger. 2317 2318@c link above to some info file(s) like the description of a.out. 2319@c don't forget to describe @sc{gnu} info as well as Unix lossage. 2320 2321@node Errors 2322@section Error and Warning Messages 2323 2324@c man begin DESCRIPTION 2325 2326@cindex error messages 2327@cindex warning messages 2328@cindex messages from assembler 2329@command{@value{AS}} may write warnings and error messages to the standard error 2330file (usually your terminal). This should not happen when a compiler 2331runs @command{@value{AS}} automatically. Warnings report an assumption made so 2332that @command{@value{AS}} could keep assembling a flawed program; errors report a 2333grave problem that stops the assembly. 2334 2335@c man end 2336 2337@cindex format of warning messages 2338Warning messages have the format 2339 2340@smallexample 2341file_name:@b{NNN}:Warning Message Text 2342@end smallexample 2343 2344@noindent 2345@cindex file names and line numbers, in warnings/errors 2346(where @b{NNN} is a line number). If both a logical file name 2347(@pxref{File,,@code{.file}}) and a logical line number 2348@ifset GENERIC 2349(@pxref{Line,,@code{.line}}) 2350@end ifset 2351have been given then they will be used, otherwise the file name and line number 2352in the current assembler source file will be used. The message text is 2353intended to be self explanatory (in the grand Unix tradition). 2354 2355Note the file name must be set via the logical version of the @code{.file} 2356directive, not the DWARF2 version of the @code{.file} directive. For example: 2357 2358@smallexample 2359 .file 2 "bar.c" 2360 error_assembler_source 2361 .file "foo.c" 2362 .line 30 2363 error_c_source 2364@end smallexample 2365 2366produces this output: 2367 2368@smallexample 2369 Assembler messages: 2370 asm.s:2: Error: no such instruction: `error_assembler_source' 2371 foo.c:31: Error: no such instruction: `error_c_source' 2372@end smallexample 2373 2374@cindex format of error messages 2375Error messages have the format 2376 2377@smallexample 2378file_name:@b{NNN}:FATAL:Error Message Text 2379@end smallexample 2380 2381The file name and line number are derived as for warning 2382messages. The actual message text may be rather less explanatory 2383because many of them aren't supposed to happen. 2384 2385@node Invoking 2386@chapter Command-Line Options 2387 2388@cindex options, all versions of assembler 2389This chapter describes command-line options available in @emph{all} 2390versions of the @sc{gnu} assembler; see @ref{Machine Dependencies}, 2391for options specific 2392@ifclear GENERIC 2393to the @value{TARGET} target. 2394@end ifclear 2395@ifset GENERIC 2396to particular machine architectures. 2397@end ifset 2398 2399@c man begin DESCRIPTION 2400 2401If you are invoking @command{@value{AS}} via the @sc{gnu} C compiler, 2402you can use the @samp{-Wa} option to pass arguments through to the assembler. 2403The assembler arguments must be separated from each other (and the @samp{-Wa}) 2404by commas. For example: 2405 2406@smallexample 2407gcc -c -g -O -Wa,-alh,-L file.c 2408@end smallexample 2409 2410@noindent 2411This passes two options to the assembler: @samp{-alh} (emit a listing to 2412standard output with high-level and assembly source) and @samp{-L} (retain 2413local symbols in the symbol table). 2414 2415Usually you do not need to use this @samp{-Wa} mechanism, since many compiler 2416command-line options are automatically passed to the assembler by the compiler. 2417(You can call the @sc{gnu} compiler driver with the @samp{-v} option to see 2418precisely what options it passes to each compilation pass, including the 2419assembler.) 2420 2421@c man end 2422 2423@menu 2424* a:: -a[cdghilns] enable listings 2425* alternate:: --alternate enable alternate macro syntax 2426* D:: -D for compatibility and debugging 2427* f:: -f to work faster 2428* I:: -I for .include search path 2429@ifclear DIFF-TBL-KLUGE 2430* K:: -K for compatibility 2431@end ifclear 2432@ifset DIFF-TBL-KLUGE 2433* K:: -K for difference tables 2434@end ifset 2435 2436* L:: -L to retain local symbols 2437* listing:: --listing-XXX to configure listing output 2438* M:: -M or --mri to assemble in MRI compatibility mode 2439* MD:: --MD for dependency tracking 2440* no-pad-sections:: --no-pad-sections to stop section padding 2441* o:: -o to name the object file 2442* R:: -R to join data and text sections 2443* statistics:: --statistics to see statistics about assembly 2444* traditional-format:: --traditional-format for compatible output 2445* v:: -v to announce version 2446* W:: -W, --no-warn, --warn, --fatal-warnings to control warnings 2447* Z:: -Z to make object file even after errors 2448@end menu 2449 2450@node a 2451@section Enable Listings: @option{-a[cdghilns]} 2452 2453@kindex -a 2454@kindex -ac 2455@kindex -ad 2456@kindex -ag 2457@kindex -ah 2458@kindex -al 2459@kindex -ali 2460@kindex -an 2461@kindex -as 2462@cindex listings, enabling 2463@cindex assembly listings, enabling 2464 2465These options enable listing output from the assembler. By itself, 2466@samp{-a} requests high-level, assembly, and symbols listing. 2467You can use other letters to select specific options for the list: 2468@samp{-ah} requests a high-level language listing, 2469@samp{-al} requests an output-program assembly listing, 2470@samp{-ali} requests an output-program assembly listing along with the 2471associated ginsn, and 2472@samp{-as} requests a symbol table listing. 2473High-level listings require that a compiler debugging option like 2474@samp{-g} be used, and that assembly listings (@samp{-al}) be requested 2475also. 2476 2477Use the @samp{-ag} option to print a first section with general assembly 2478information, like @value{AS} version, switches passed, or time stamp. 2479 2480Use the @samp{-ac} option to omit false conditionals from a listing. Any lines 2481which are not assembled because of a false @code{.if} (or @code{.ifdef}, or any 2482other conditional), or a true @code{.if} followed by an @code{.else}, will be 2483omitted from the listing. 2484 2485Use the @samp{-ad} option to omit debugging directives from the 2486listing. 2487 2488Once you have specified one of these options, you can further control 2489listing output and its appearance using the directives @code{.list}, 2490@code{.nolist}, @code{.psize}, @code{.eject}, @code{.title}, and 2491@code{.sbttl}. 2492The @samp{-an} option turns off all forms processing. 2493If you do not request listing output with one of the @samp{-a} options, the 2494listing-control directives have no effect. 2495 2496The letters after @samp{-a} may be combined into one option, 2497@emph{e.g.}, @samp{-aln}. 2498 2499Note if the assembler source is coming from the standard input (e.g., 2500because it 2501is being created by @code{@value{GCC}} and the @samp{-pipe} command-line switch 2502is being used) then the listing will not contain any comments or preprocessor 2503directives. This is because the listing code buffers input source lines from 2504stdin only after they have been preprocessed by the assembler. This reduces 2505memory usage and makes the code more efficient. 2506 2507@node alternate 2508@section @option{--alternate} 2509 2510@kindex --alternate 2511Begin in alternate macro mode, see @ref{Altmacro,,@code{.altmacro}}. 2512 2513@node D 2514@section @option{-D} 2515 2516@kindex -D 2517This option enables debugging, if it is supported by the assembler's 2518configuration. Otherwise it does nothing as is ignored. This allows scripts 2519designed to work with other assemblers to also work with GAS. 2520@command{@value{AS}}. 2521 2522@node f 2523@section Work Faster: @option{-f} 2524 2525@kindex -f 2526@cindex trusted compiler 2527@cindex faster processing (@option{-f}) 2528@samp{-f} should only be used when assembling programs written by a 2529(trusted) compiler. @samp{-f} stops the assembler from doing whitespace 2530and comment preprocessing on 2531the input file(s) before assembling them. @xref{Preprocessing, 2532,Preprocessing}. 2533 2534@quotation 2535@emph{Warning:} if you use @samp{-f} when the files actually need to be 2536preprocessed (if they contain comments, for example), @command{@value{AS}} does 2537not work correctly. 2538@end quotation 2539 2540@node I 2541@section @code{.include} Search Path: @option{-I} @var{path} 2542 2543@kindex -I @var{path} 2544@cindex paths for @code{.include} 2545@cindex search path for @code{.include} 2546@cindex @code{include} directive search path 2547Use this option to add a @var{path} to the list of directories 2548@command{@value{AS}} searches for files specified in @code{.include} 2549directives (@pxref{Include,,@code{.include}}). You may use @option{-I} as 2550many times as necessary to include a variety of paths. The current 2551working directory is always searched first; after that, @command{@value{AS}} 2552searches any @samp{-I} directories in the same order as they were 2553specified (left to right) on the command line. 2554 2555@node K 2556@section Difference Tables: @option{-K} 2557 2558@kindex -K 2559@ifclear DIFF-TBL-KLUGE 2560On the @value{TARGET} family, this option is allowed, but has no effect. It is 2561permitted for compatibility with the @sc{gnu} assembler on other platforms, 2562where it can be used to warn when the assembler alters the machine code 2563generated for @samp{.word} directives in difference tables. The @value{TARGET} 2564family does not have the addressing limitations that sometimes lead to this 2565alteration on other platforms. 2566@end ifclear 2567 2568@ifset DIFF-TBL-KLUGE 2569@cindex difference tables, warning 2570@cindex warning for altered difference tables 2571@command{@value{AS}} sometimes alters the code emitted for directives of the 2572form @samp{.word @var{sym1}-@var{sym2}}. @xref{Word,,@code{.word}}. 2573You can use the @samp{-K} option if you want a warning issued when this 2574is done. 2575@end ifset 2576 2577@node L 2578@section Include Local Symbols: @option{-L} 2579 2580@kindex -L 2581@cindex local symbols, retaining in output 2582Symbols beginning with system-specific local label prefixes, typically 2583@samp{.L} for ELF systems or @samp{L} for traditional a.out systems, are 2584called @dfn{local symbols}. @xref{Symbol Names}. Normally you do not see 2585such symbols when debugging, because they are intended for the use of 2586programs (like compilers) that compose assembler programs, not for your 2587notice. Normally both @command{@value{AS}} and @code{@value{LD}} discard 2588such symbols, so you do not normally debug with them. 2589 2590This option tells @command{@value{AS}} to retain those local symbols 2591in the object file. Usually if you do this you also tell the linker 2592@code{@value{LD}} to preserve those symbols. 2593 2594@node listing 2595@section Configuring listing output: @option{--listing} 2596 2597The listing feature of the assembler can be enabled via the command-line switch 2598@samp{-a} (@pxref{a}). This feature combines the input source file(s) with a 2599hex dump of the corresponding locations in the output object file, and displays 2600them as a listing file. The format of this listing can be controlled by 2601directives inside the assembler source (i.e., @code{.list} (@pxref{List}), 2602@code{.title} (@pxref{Title}), @code{.sbttl} (@pxref{Sbttl}), 2603@code{.psize} (@pxref{Psize}), and 2604@code{.eject} (@pxref{Eject}) and also by the following switches: 2605 2606@table @gcctabopt 2607@item --listing-lhs-width=@samp{number} 2608@kindex --listing-lhs-width 2609@cindex Width of first line disassembly output 2610Sets the maximum width, in words, of the first line of the hex byte dump. This 2611dump appears on the left hand side of the listing output. 2612 2613@item --listing-lhs-width2=@samp{number} 2614@kindex --listing-lhs-width2 2615@cindex Width of continuation lines of disassembly output 2616Sets the maximum width, in words, of any further lines of the hex byte dump for 2617a given input source line. If this value is not specified, it defaults to being 2618the same as the value specified for @samp{--listing-lhs-width}. If neither 2619switch is used the default is to one. 2620 2621@item --listing-rhs-width=@samp{number} 2622@kindex --listing-rhs-width 2623@cindex Width of source line output 2624Sets the maximum width, in characters, of the source line that is displayed 2625alongside the hex dump. The default value for this parameter is 100. The 2626source line is displayed on the right hand side of the listing output. 2627 2628@item --listing-cont-lines=@samp{number} 2629@kindex --listing-cont-lines 2630@cindex Maximum number of continuation lines 2631Sets the maximum number of continuation lines of hex dump that will be 2632displayed for a given single line of source input. The default value is 4. 2633@end table 2634 2635@node M 2636@section Assemble in MRI Compatibility Mode: @option{-M} 2637 2638@kindex -M 2639@cindex MRI compatibility mode 2640The @option{-M} or @option{--mri} option selects MRI compatibility mode. This 2641changes the syntax and pseudo-op handling of @command{@value{AS}} to make it 2642compatible with the @code{ASM68K} assembler from Microtec Research. 2643The exact nature of the 2644MRI syntax will not be documented here; see the MRI manuals for more 2645information. Note in particular that the handling of macros and macro 2646arguments is somewhat different. The purpose of this option is to permit 2647assembling existing MRI assembler code using @command{@value{AS}}. 2648 2649The MRI compatibility is not complete. Certain operations of the MRI assembler 2650depend upon its object file format, and can not be supported using other object 2651file formats. Supporting these would require enhancing each object file format 2652individually. These are: 2653 2654@itemize @bullet 2655@item global symbols in common section 2656 2657The m68k MRI assembler supports common sections which are merged by the linker. 2658Other object file formats do not support this. @command{@value{AS}} handles 2659common sections by treating them as a single common symbol. It permits local 2660symbols to be defined within a common section, but it can not support global 2661symbols, since it has no way to describe them. 2662 2663@item complex relocations 2664 2665The MRI assemblers support relocations against a negated section address, and 2666relocations which combine the start addresses of two or more sections. These 2667are not support by other object file formats. 2668 2669@item @code{END} pseudo-op specifying start address 2670 2671The MRI @code{END} pseudo-op permits the specification of a start address. 2672This is not supported by other object file formats. The start address may 2673instead be specified using the @option{-e} option to the linker, or in a linker 2674script. 2675 2676@item @code{IDNT}, @code{.ident} and @code{NAME} pseudo-ops 2677 2678The MRI @code{IDNT}, @code{.ident} and @code{NAME} pseudo-ops assign a module 2679name to the output file. This is not supported by other object file formats. 2680 2681@item @code{ORG} pseudo-op 2682 2683The m68k MRI @code{ORG} pseudo-op begins an absolute section at a given 2684address. This differs from the usual @command{@value{AS}} @code{.org} pseudo-op, 2685which changes the location within the current section. Absolute sections are 2686not supported by other object file formats. The address of a section may be 2687assigned within a linker script. 2688@end itemize 2689 2690There are some other features of the MRI assembler which are not supported by 2691@command{@value{AS}}, typically either because they are difficult or because they 2692seem of little consequence. Some of these may be supported in future releases. 2693 2694@itemize @bullet 2695 2696@item EBCDIC strings 2697 2698EBCDIC strings are not supported. 2699 2700@item packed binary coded decimal 2701 2702Packed binary coded decimal is not supported. This means that the @code{DC.P} 2703and @code{DCB.P} pseudo-ops are not supported. 2704 2705@item @code{FEQU} pseudo-op 2706 2707The m68k @code{FEQU} pseudo-op is not supported. 2708 2709@item @code{NOOBJ} pseudo-op 2710 2711The m68k @code{NOOBJ} pseudo-op is not supported. 2712 2713@item @code{OPT} branch control options 2714 2715The m68k @code{OPT} branch control options---@code{B}, @code{BRS}, @code{BRB}, 2716@code{BRL}, and @code{BRW}---are ignored. @command{@value{AS}} automatically 2717relaxes all branches, whether forward or backward, to an appropriate size, so 2718these options serve no purpose. 2719 2720@item @code{OPT} list control options 2721 2722The following m68k @code{OPT} list control options are ignored: @code{C}, 2723@code{CEX}, @code{CL}, @code{CRE}, @code{E}, @code{G}, @code{I}, @code{M}, 2724@code{MEX}, @code{MC}, @code{MD}, @code{X}. 2725 2726@item other @code{OPT} options 2727 2728The following m68k @code{OPT} options are ignored: @code{NEST}, @code{O}, 2729@code{OLD}, @code{OP}, @code{P}, @code{PCO}, @code{PCR}, @code{PCS}, @code{R}. 2730 2731@item @code{OPT} @code{D} option is default 2732 2733The m68k @code{OPT} @code{D} option is the default, unlike the MRI assembler. 2734@code{OPT NOD} may be used to turn it off. 2735 2736@item @code{XREF} pseudo-op. 2737 2738The m68k @code{XREF} pseudo-op is ignored. 2739 2740@end itemize 2741 2742@node MD 2743@section Dependency Tracking: @option{--MD} 2744 2745@kindex --MD 2746@cindex dependency tracking 2747@cindex make rules 2748 2749@command{@value{AS}} can generate a dependency file for the file it creates. This 2750file consists of a single rule suitable for @code{make} describing the 2751dependencies of the main source file. 2752 2753The rule is written to the file named in its argument. 2754 2755This feature is used in the automatic updating of makefiles. 2756 2757@node no-pad-sections 2758@section Output Section Padding 2759@kindex --no-pad-sections 2760@cindex output section padding 2761Normally the assembler will pad the end of each output section up to its 2762alignment boundary. But this can waste space, which can be significant on 2763memory constrained targets. So the @option{--no-pad-sections} option will 2764disable this behaviour. 2765 2766@node o 2767@section Name the Object File: @option{-o} 2768 2769@kindex -o 2770@cindex naming object file 2771@cindex object file name 2772There is always one object file output when you run @command{@value{AS}}. By 2773default it has the name @file{a.out}. 2774You use this option (which takes exactly one filename) to give the 2775object file a different name. 2776 2777Whatever the object file is called, @command{@value{AS}} overwrites any 2778existing file of the same name. 2779 2780@node R 2781@section Join Data and Text Sections: @option{-R} 2782 2783@kindex -R 2784@cindex data and text sections, joining 2785@cindex text and data sections, joining 2786@cindex joining text and data sections 2787@cindex merging text and data sections 2788@option{-R} tells @command{@value{AS}} to write the object file as if all 2789data-section data lives in the text section. This is only done at 2790the very last moment: your binary data are the same, but data 2791section parts are relocated differently. The data section part of 2792your object file is zero bytes long because all its bytes are 2793appended to the text section. (@xref{Sections,,Sections and Relocation}.) 2794 2795When you specify @option{-R} it would be possible to generate shorter 2796address displacements (because we do not have to cross between text and 2797data section). We refrain from doing this simply for compatibility with 2798older versions of @command{@value{AS}}. In future, @option{-R} may work this way. 2799 2800@ifset COFF-ELF 2801When @command{@value{AS}} is configured for COFF or ELF output, 2802this option is only useful if you use sections named @samp{.text} and 2803@samp{.data}. 2804@end ifset 2805 2806@ifset HPPA 2807@option{-R} is not supported for any of the HPPA targets. Using 2808@option{-R} generates a warning from @command{@value{AS}}. 2809@end ifset 2810 2811@node statistics 2812@section Display Assembly Statistics: @option{--statistics} 2813 2814@kindex --statistics 2815@cindex statistics, about assembly 2816@cindex time, total for assembly 2817@cindex space used, maximum for assembly 2818Use @samp{--statistics} to display two statistics about the resources used by 2819@command{@value{AS}}: the maximum amount of space allocated during the assembly 2820(in bytes), and the total execution time taken for the assembly (in @sc{cpu} 2821seconds). 2822 2823@node traditional-format 2824@section Compatible Output: @option{--traditional-format} 2825 2826@kindex --traditional-format 2827For some targets, the output of @command{@value{AS}} is different in some ways 2828from the output of some existing assembler. This switch requests 2829@command{@value{AS}} to use the traditional format instead. 2830 2831For example, it disables the exception frame optimizations which 2832@command{@value{AS}} normally does by default on @code{@value{GCC}} output. 2833 2834@node v 2835@section Announce Version: @option{-v} 2836 2837@kindex -v 2838@kindex -version 2839@cindex assembler version 2840@cindex version of assembler 2841You can find out what version of as is running by including the 2842option @samp{-v} (which you can also spell as @samp{-version}) on the 2843command line. 2844 2845@node W 2846@section Control Warnings: @option{-W}, @option{--warn}, @option{--no-warn}, @option{--fatal-warnings} 2847 2848@command{@value{AS}} should never give a warning or error message when 2849assembling compiler output. But programs written by people often 2850cause @command{@value{AS}} to give a warning that a particular assumption was 2851made. All such warnings are directed to the standard error file. 2852 2853@kindex -W 2854@kindex --no-warn 2855@cindex suppressing warnings 2856@cindex warnings, suppressing 2857If you use the @option{-W} and @option{--no-warn} options, no warnings are issued. 2858This only affects the warning messages: it does not change any particular of 2859how @command{@value{AS}} assembles your file. Errors, which stop the assembly, 2860are still reported. 2861 2862@kindex --fatal-warnings 2863@cindex errors, caused by warnings 2864@cindex warnings, causing error 2865If you use the @option{--fatal-warnings} option, @command{@value{AS}} considers 2866files that generate warnings to be in error. 2867 2868@kindex --warn 2869@cindex warnings, switching on 2870You can switch these options off again by specifying @option{--warn}, which 2871causes warnings to be output as usual. 2872 2873@node Z 2874@section Generate Object File in Spite of Errors: @option{-Z} 2875@cindex object file, after errors 2876@cindex errors, continuing after 2877After an error message, @command{@value{AS}} normally produces no output. If for 2878some reason you are interested in object file output even after 2879@command{@value{AS}} gives an error message on your program, use the @samp{-Z} 2880option. If there are any errors, @command{@value{AS}} continues anyways, and 2881writes an object file after a final warning message of the form @samp{@var{n} 2882errors, @var{m} warnings, generating bad object file.} 2883 2884@node Syntax 2885@chapter Syntax 2886 2887@cindex machine-independent syntax 2888@cindex syntax, machine-independent 2889This chapter describes the machine-independent syntax allowed in a 2890source file. @command{@value{AS}} syntax is similar to what many other 2891assemblers use; it is inspired by the BSD 4.2 2892@ifclear VAX 2893assembler. 2894@end ifclear 2895@ifset VAX 2896assembler, except that @command{@value{AS}} does not assemble Vax bit-fields. 2897@end ifset 2898 2899@menu 2900* Preprocessing:: Preprocessing 2901* Whitespace:: Whitespace 2902* Comments:: Comments 2903* Symbol Intro:: Symbols 2904* Statements:: Statements 2905* Constants:: Constants 2906@end menu 2907 2908@node Preprocessing 2909@section Preprocessing 2910 2911@cindex preprocessing 2912The @command{@value{AS}} internal preprocessor: 2913@itemize @bullet 2914@cindex whitespace, removed by preprocessor 2915@item 2916adjusts and removes extra whitespace. It leaves one space or tab before 2917the keywords on a line, and turns any other whitespace on the line into 2918a single space. 2919 2920@cindex comments, removed by preprocessor 2921@item 2922removes all comments, replacing them with a single space, or an 2923appropriate number of newlines. 2924 2925@cindex constants, converted by preprocessor 2926@item 2927converts character constants into the appropriate numeric values. 2928@end itemize 2929 2930It does not do macro processing, include file handling, or 2931anything else you may get from your C compiler's preprocessor. You can 2932do include file processing with the @code{.include} directive 2933(@pxref{Include,,@code{.include}}). You can use the @sc{gnu} C compiler driver 2934to get other ``CPP'' style preprocessing by giving the input file a 2935@samp{.S} suffix. @url{https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html#Overall-Options, 2936See the 'Options Controlling the Kind of Output' section of the GCC manual for 2937more details} 2938 2939Excess whitespace, comments, and character constants 2940cannot be used in the portions of the input text that are not 2941preprocessed. 2942 2943@cindex turning preprocessing on and off 2944@cindex preprocessing, turning on and off 2945@kindex #NO_APP 2946@kindex #APP 2947If the first line of an input file is @code{#NO_APP} or if you use the 2948@samp{-f} option, whitespace and comments are not removed from the input file. 2949Within an input file, you can ask for whitespace and comment removal in 2950specific portions of the file by putting a line that says @code{#APP} before the 2951text that may contain whitespace or comments, and putting a line that says 2952@code{#NO_APP} after this text. This feature is mainly intended to support 2953@code{asm} statements in compilers whose output is otherwise free of comments 2954and whitespace. 2955 2956@node Whitespace 2957@section Whitespace 2958 2959@cindex whitespace 2960@dfn{Whitespace} is one or more blanks or tabs, in any order. 2961Whitespace is used to separate symbols, and to make programs neater for 2962people to read. Unless within character constants 2963(@pxref{Characters,,Character Constants}), any whitespace means the same 2964as exactly one space. 2965 2966@node Comments 2967@section Comments 2968 2969@cindex comments 2970There are two ways of rendering comments to @command{@value{AS}}. In both 2971cases the comment is equivalent to one space. 2972 2973Anything from @samp{/*} through the next @samp{*/} is a comment. 2974This means you may not nest these comments. 2975 2976@smallexample 2977/* 2978 The only way to include a newline ('\n') in a comment 2979 is to use this sort of comment. 2980*/ 2981 2982/* This sort of comment does not nest. */ 2983@end smallexample 2984 2985@cindex line comment character 2986Anything from a @dfn{line comment} character up to the next newline is 2987considered a comment and is ignored. The line comment character is target 2988specific, and some targets support multiple comment characters. Some targets 2989also have line comment characters that only work if they are the first 2990character on a line. Some targets use a sequence of two characters to 2991introduce a line comment. Some targets can also change their line comment 2992characters depending upon command-line options that have been used. For more 2993details see the @emph{Syntax} section in the documentation for individual 2994targets. 2995 2996If the line comment character is the hash sign (@samp{#}) then it still has the 2997special ability to enable and disable preprocessing (@pxref{Preprocessing}) and 2998to specify logical line numbers: 2999 3000@kindex # 3001@cindex lines starting with @code{#} 3002@cindex logical line numbers 3003To be compatible with past assemblers, lines that begin with @samp{#} have a 3004special interpretation. Following the @samp{#} should be an absolute 3005expression (@pxref{Expressions}): the logical line number of the @emph{next} 3006line. Then a string (@pxref{Strings, ,Strings}) is allowed: if present it is a 3007new logical file name. The rest of the line, if any, should be whitespace. 3008 3009If the first non-whitespace characters on the line are not numeric, 3010the line is ignored. (Just like a comment.) 3011 3012@smallexample 3013 # This is an ordinary comment. 3014# 42-6 "new_file_name" # New logical file name 3015 # This is logical line # 36. 3016@end smallexample 3017This feature is deprecated, and may disappear from future versions 3018of @command{@value{AS}}. 3019 3020@node Symbol Intro 3021@section Symbols 3022 3023@cindex characters used in symbols 3024@ifclear SPECIAL-SYMS 3025A @dfn{symbol} is one or more characters chosen from the set of all 3026letters (both upper and lower case), digits and the three characters 3027@samp{_.$}. 3028@end ifclear 3029@ifset SPECIAL-SYMS 3030@ifclear GENERIC 3031@ifset H8 3032A @dfn{symbol} is one or more characters chosen from the set of all 3033letters (both upper and lower case), digits and the three characters 3034@samp{._$}. (Save that, on the H8/300 only, you may not use @samp{$} in 3035symbol names.) 3036@end ifset 3037@end ifclear 3038@end ifset 3039@ifset GENERIC 3040On most machines, you can also use @code{$} in symbol names; exceptions 3041are noted in @ref{Machine Dependencies}. 3042@end ifset 3043No symbol may begin with a digit. Case is significant. 3044There is no length limit; all characters are significant. Multibyte characters 3045are supported, but note that the setting of the 3046@option{--multibyte-handling} option might prevent their use. Symbols 3047are delimited by characters not in that set, or by the beginning of a file 3048(since the source program must end with a newline, the end of a file is not a 3049possible symbol delimiter). @xref{Symbols}. 3050 3051Symbol names may also be enclosed in double quote @code{"} characters. In such 3052cases any characters are allowed, except for the NUL character. If a double 3053quote character is to be included in the symbol name it must be preceded by a 3054backslash @code{\} character. 3055@cindex length of symbols 3056 3057@node Statements 3058@section Statements 3059 3060@cindex statements, structure of 3061@cindex line separator character 3062@cindex statement separator character 3063 3064A @dfn{statement} ends at a newline character (@samp{\n}) or a 3065@dfn{line separator character}. The line separator character is target 3066specific and described in the @emph{Syntax} section of each 3067target's documentation. Not all targets support a line separator character. 3068The newline or line separator character is considered to be part of the 3069preceding statement. Newlines and separators within character constants are an 3070exception: they do not end statements. 3071 3072@cindex newline, required at file end 3073@cindex EOF, newline must precede 3074It is an error to end any statement with end-of-file: the last 3075character of any input file should be a newline. 3076 3077An empty statement is allowed, and may include whitespace. It is ignored. 3078 3079@cindex instructions and directives 3080@cindex directives and instructions 3081@c "key symbol" is not used elsewhere in the document; seems pedantic to 3082@c @defn{} it in that case, as was done previously... doc@cygnus.com, 3083@c 13feb91. 3084A statement begins with zero or more labels, optionally followed by a 3085key symbol which determines what kind of statement it is. The key 3086symbol determines the syntax of the rest of the statement. If the 3087symbol begins with a dot @samp{.} then the statement is an assembler 3088directive: typically valid for any computer. If the symbol begins with 3089a letter the statement is an assembly language @dfn{instruction}: it 3090assembles into a machine language instruction. 3091@ifset GENERIC 3092Different versions of @command{@value{AS}} for different computers 3093recognize different instructions. In fact, the same symbol may 3094represent a different instruction in a different computer's assembly 3095language. 3096@end ifset 3097 3098@cindex @code{:} (label) 3099@cindex label (@code{:}) 3100A label is a symbol immediately followed by a colon (@code{:}). 3101Whitespace before a label or after a colon is permitted, but you may not 3102have whitespace between a label's symbol and its colon. @xref{Labels}. 3103 3104@ifset HPPA 3105For HPPA targets, labels need not be immediately followed by a colon, but 3106the definition of a label must begin in column zero. This also implies that 3107only one label may be defined on each line. 3108@end ifset 3109 3110@smallexample 3111label: .directive followed by something 3112another_label: # This is an empty statement. 3113 instruction operand_1, operand_2, @dots{} 3114@end smallexample 3115 3116@node Constants 3117@section Constants 3118 3119@cindex constants 3120A constant is a number, written so that its value is known by 3121inspection, without knowing any context. Like this: 3122@smallexample 3123@group 3124.byte 74, 0112, 092, 0x4A, 0X4a, 'J, '\J # All the same value. 3125.ascii "Ring the bell\7" # A string constant. 3126.octa 0x123456789abcdef0123456789ABCDEF0 # A bignum. 3127.float 0f-314159265358979323846264338327\ 312895028841971.693993751E-40 # - pi, a flonum. 3129@end group 3130@end smallexample 3131 3132@menu 3133* Characters:: Character Constants 3134* Numbers:: Number Constants 3135@end menu 3136 3137@node Characters 3138@subsection Character Constants 3139 3140@cindex character constants 3141@cindex constants, character 3142There are two kinds of character constants. A @dfn{character} stands 3143for one character in one byte and its value may be used in 3144numeric expressions. String constants (properly called string 3145@emph{literals}) are potentially many bytes and their values may not be 3146used in arithmetic expressions. 3147 3148@menu 3149* Strings:: Strings 3150* Chars:: Characters 3151@end menu 3152 3153@node Strings 3154@subsubsection Strings 3155 3156@cindex string constants 3157@cindex constants, string 3158A @dfn{string} is written between double-quotes. It may contain 3159double-quotes or null characters. The way to get special characters 3160into a string is to @dfn{escape} these characters: precede them with 3161a backslash @samp{\} character. For example @samp{\\} represents 3162one backslash: the first @code{\} is an escape which tells 3163@command{@value{AS}} to interpret the second character literally as a backslash 3164(which prevents @command{@value{AS}} from recognizing the second @code{\} as an 3165escape character). The complete list of escapes follows. 3166 3167@cindex escape codes, character 3168@cindex character escape codes 3169@c NOTE: Cindex entries must not start with a backlash character. 3170@c NOTE: This confuses the pdf2texi script when it is creating the 3171@c NOTE: index based upon the first character and so it generates: 3172@c NOTE: \initial {\\} 3173@c NOTE: which then results in the error message: 3174@c NOTE: Argument of \\ has an extra }. 3175@c NOTE: So in the index entries below a space character has been 3176@c NOTE: prepended to avoid this problem. 3177@table @kbd 3178@c @item \a 3179@c Mnemonic for ACKnowledge; for ASCII this is octal code 007. 3180@c 3181@cindex @code{ \b} (backspace character) 3182@cindex backspace (@code{\b}) 3183@item \b 3184Mnemonic for backspace; for ASCII this is octal code 010. 3185 3186@c @item \e 3187@c Mnemonic for EOText; for ASCII this is octal code 004. 3188@c 3189@cindex @code{ \f} (formfeed character) 3190@cindex formfeed (@code{\f}) 3191@item backslash-f 3192Mnemonic for FormFeed; for ASCII this is octal code 014. 3193 3194@cindex @code{ \n} (newline character) 3195@cindex newline (@code{\n}) 3196@item \n 3197Mnemonic for newline; for ASCII this is octal code 012. 3198 3199@c @item \p 3200@c Mnemonic for prefix; for ASCII this is octal code 033, usually known as @code{escape}. 3201@c 3202@cindex @code{ \r} (carriage return character) 3203@cindex carriage return (@code{backslash-r}) 3204@item \r 3205Mnemonic for carriage-Return; for ASCII this is octal code 015. 3206 3207@c @item \s 3208@c Mnemonic for space; for ASCII this is octal code 040. Included for compliance with 3209@c other assemblers. 3210@c 3211@cindex @code{ \t} (tab) 3212@cindex tab (@code{\t}) 3213@item \t 3214Mnemonic for horizontal Tab; for ASCII this is octal code 011. 3215 3216@c @item \v 3217@c Mnemonic for Vertical tab; for ASCII this is octal code 013. 3218@c @item \x @var{digit} @var{digit} @var{digit} 3219@c A hexadecimal character code. The numeric code is 3 hexadecimal digits. 3220@c 3221@cindex @code{ \@var{ddd}} (octal character code) 3222@cindex octal character code (@code{\@var{ddd}}) 3223@item \ @var{digit} @var{digit} @var{digit} 3224An octal character code. The numeric code is 3 octal digits. 3225For compatibility with other Unix systems, 8 and 9 are accepted as digits: 3226for example, @code{\008} has the value 010, and @code{\009} the value 011. 3227 3228@cindex @code{ \@var{xd...}} (hex character code) 3229@cindex hex character code (@code{\@var{xd...}}) 3230@item \@code{x} @var{hex-digits...} 3231A hex character code. All trailing hex digits are combined. Either upper or 3232lower case @code{x} works. 3233 3234@cindex @code{ \\} (@samp{\} character) 3235@cindex backslash (@code{\\}) 3236@item \\ 3237Represents one @samp{\} character. 3238 3239@c @item \' 3240@c Represents one @samp{'} (accent acute) character. 3241@c This is needed in single character literals 3242@c (@xref{Characters,,Character Constants}.) to represent 3243@c a @samp{'}. 3244@c 3245@cindex @code{ \"} (doublequote character) 3246@cindex doublequote (@code{\"}) 3247@item \" 3248Represents one @samp{"} character. Needed in strings to represent 3249this character, because an unescaped @samp{"} would end the string. 3250 3251@item \ @var{anything-else} 3252Any other character when escaped by @kbd{\} gives a warning, but 3253assembles as if the @samp{\} was not present. The idea is that if 3254you used an escape sequence you clearly didn't want the literal 3255interpretation of the following character. However @command{@value{AS}} has no 3256other interpretation, so @command{@value{AS}} knows it is giving you the wrong 3257code and warns you of the fact. 3258@end table 3259 3260Which characters are escapable, and what those escapes represent, 3261varies widely among assemblers. The current set is what we think 3262the BSD 4.2 assembler recognizes, and is a subset of what most C 3263compilers recognize. If you are in doubt, do not use an escape 3264sequence. 3265 3266@node Chars 3267@subsubsection Characters 3268 3269@cindex single character constant 3270@cindex character, single 3271@cindex constant, single character 3272A single character may be written as a single quote immediately followed by 3273that character. Some backslash escapes apply to characters, @code{\b}, 3274@code{\f}, @code{\n}, @code{\r}, @code{\t}, and @code{\"} with the same meaning 3275as for strings, plus @code{\'} for a single quote. So if you want to write the 3276character backslash, you must write @kbd{'\\} where the first @code{\} escapes 3277the second @code{\}. As you can see, the quote is an acute accent, not a grave 3278accent. A newline 3279@ifclear GENERIC 3280@ifclear abnormal-separator 3281(or semicolon @samp{;}) 3282@end ifclear 3283@ifset abnormal-separator 3284@ifset H8 3285(or dollar sign @samp{$}, for the H8/300; or semicolon @samp{;} for the 3286Renesas SH) 3287@end ifset 3288@end ifset 3289@end ifclear 3290immediately following an acute accent is taken as a literal character 3291and does not count as the end of a statement. The value of a character 3292constant in a numeric expression is the machine's byte-wide code for 3293that character. @command{@value{AS}} assumes your character code is ASCII: 3294@kbd{'A} means 65, @kbd{'B} means 66, and so on. 3295 3296@node Numbers 3297@subsection Number Constants 3298 3299@cindex constants, number 3300@cindex number constants 3301@command{@value{AS}} distinguishes three kinds of numbers according to how they 3302are stored in the target machine. @emph{Integers} are numbers that 3303would fit into an @code{int} in the C language. @emph{Bignums} are 3304integers, but they are stored in more than 32 bits. @emph{Flonums} 3305are floating point numbers, described below. 3306 3307@menu 3308* Integers:: Integers 3309* Bignums:: Bignums 3310* Flonums:: Flonums 3311@ifclear GENERIC 3312@end ifclear 3313@end menu 3314 3315@node Integers 3316@subsubsection Integers 3317@cindex integers 3318@cindex constants, integer 3319 3320@cindex binary integers 3321@cindex integers, binary 3322A binary integer is @samp{0b} or @samp{0B} followed by zero or more of 3323the binary digits @samp{01}. 3324 3325@cindex octal integers 3326@cindex integers, octal 3327An octal integer is @samp{0} followed by zero or more of the octal 3328digits (@samp{01234567}). 3329 3330@cindex decimal integers 3331@cindex integers, decimal 3332A decimal integer starts with a non-zero digit followed by zero or 3333more digits (@samp{0123456789}). 3334 3335@cindex hexadecimal integers 3336@cindex integers, hexadecimal 3337A hexadecimal integer is @samp{0x} or @samp{0X} followed by one or 3338more hexadecimal digits chosen from @samp{0123456789abcdefABCDEF}. 3339 3340Integers have the usual values. To denote a negative integer, use 3341the prefix operator @samp{-} discussed under expressions 3342(@pxref{Prefix Ops,,Prefix Operators}). 3343 3344@node Bignums 3345@subsubsection Bignums 3346 3347@cindex bignums 3348@cindex constants, bignum 3349A @dfn{bignum} has the same syntax and semantics as an integer 3350except that the number (or its negative) takes more than 32 bits to 3351represent in binary. The distinction is made because in some places 3352integers are permitted while bignums are not. 3353 3354@node Flonums 3355@subsubsection Flonums 3356@cindex flonums 3357@cindex floating point numbers 3358@cindex constants, floating point 3359 3360@cindex precision, floating point 3361A @dfn{flonum} represents a floating point number. The translation is 3362indirect: a decimal floating point number from the text is converted by 3363@command{@value{AS}} to a generic binary floating point number of more than 3364sufficient precision. This generic floating point number is converted 3365to a particular computer's floating point format (or formats) by a 3366portion of @command{@value{AS}} specialized to that computer. 3367 3368A flonum is written by writing (in order) 3369@itemize @bullet 3370@item 3371The digit @samp{0}. 3372@ifset HPPA 3373(@samp{0} is optional on the HPPA.) 3374@end ifset 3375 3376@item 3377A letter, to tell @command{@value{AS}} the rest of the number is a flonum. 3378@ifset GENERIC 3379@kbd{e} is recommended. Case is not important. 3380@ignore 3381@c FIXME: verify if flonum syntax really this vague for most cases 3382(Any otherwise illegal letter works here, but that might be changed. Vax BSD 33834.2 assembler seems to allow any of @samp{defghDEFGH}.) 3384@end ignore 3385 3386On the H8/300 and Renesas / SuperH SH architectures, the letter must be 3387one of the letters @samp{DFPRSX} (in upper or lower case). 3388 3389On the ARC, the letter must be one of the letters @samp{DFRS} 3390(in upper or lower case). 3391 3392On the HPPA architecture, the letter must be @samp{E} (upper case only). 3393@end ifset 3394@ifclear GENERIC 3395@ifset ARC 3396One of the letters @samp{DFRS} (in upper or lower case). 3397@end ifset 3398@ifset H8 3399One of the letters @samp{DFPRSX} (in upper or lower case). 3400@end ifset 3401@ifset HPPA 3402The letter @samp{E} (upper case only). 3403@end ifset 3404@end ifclear 3405 3406@item 3407An optional sign: either @samp{+} or @samp{-}. 3408 3409@item 3410An optional @dfn{integer part}: zero or more decimal digits. 3411 3412@item 3413An optional @dfn{fractional part}: @samp{.} followed by zero 3414or more decimal digits. 3415 3416@item 3417An optional exponent, consisting of: 3418 3419@itemize @bullet 3420@item 3421An @samp{E} or @samp{e}. 3422@c I can't find a config where "EXP_CHARS" is other than 'eE', but in 3423@c principle this can perfectly well be different on different targets. 3424@item 3425Optional sign: either @samp{+} or @samp{-}. 3426@item 3427One or more decimal digits. 3428@end itemize 3429 3430@end itemize 3431 3432At least one of the integer part or the fractional part must be 3433present. The floating point number has the usual base-10 value. 3434 3435@command{@value{AS}} does all processing using integers. Flonums are computed 3436independently of any floating point hardware in the computer running 3437@command{@value{AS}}. 3438 3439@node Sections 3440@chapter Sections and Relocation 3441@cindex sections 3442@cindex relocation 3443 3444@menu 3445* Secs Background:: Background 3446* Ld Sections:: Linker Sections 3447* As Sections:: Assembler Internal Sections 3448* Sub-Sections:: Sub-Sections 3449* bss:: bss Section 3450@end menu 3451 3452@node Secs Background 3453@section Background 3454 3455Roughly, a section is a range of addresses, with no gaps; all data 3456``in'' those addresses is treated the same for some particular purpose. 3457For example there may be a ``read only'' section. 3458 3459@cindex linker, and assembler 3460@cindex assembler, and linker 3461The linker @code{@value{LD}} reads many object files (partial programs) and 3462combines their contents to form a runnable program. When @command{@value{AS}} 3463emits an object file, the partial program is assumed to start at address 0. 3464@code{@value{LD}} assigns the final addresses for the partial program, so that 3465different partial programs do not overlap. This is actually an 3466oversimplification, but it suffices to explain how @command{@value{AS}} uses 3467sections. 3468 3469@code{@value{LD}} moves blocks of bytes of your program to their run-time 3470addresses. These blocks slide to their run-time addresses as rigid 3471units; their length does not change and neither does the order of bytes 3472within them. Such a rigid unit is called a @emph{section}. Assigning 3473run-time addresses to sections is called @dfn{relocation}. It includes 3474the task of adjusting mentions of object-file addresses so they refer to 3475the proper run-time addresses. 3476@ifset H8 3477For the H8/300, and for the Renesas / SuperH SH, 3478@command{@value{AS}} pads sections if needed to 3479ensure they end on a word (sixteen bit) boundary. 3480@end ifset 3481 3482@cindex standard assembler sections 3483An object file written by @command{@value{AS}} has at least three sections, any 3484of which may be empty. These are named @dfn{text}, @dfn{data} and 3485@dfn{bss} sections. 3486 3487@ifset COFF-ELF 3488@ifset GENERIC 3489When it generates COFF or ELF output, 3490@end ifset 3491@command{@value{AS}} can also generate whatever other named sections you specify 3492using the @samp{.section} directive (@pxref{Section,,@code{.section}}). 3493If you do not use any directives that place output in the @samp{.text} 3494or @samp{.data} sections, these sections still exist, but are empty. 3495@end ifset 3496 3497@ifset HPPA 3498@ifset GENERIC 3499When @command{@value{AS}} generates SOM or ELF output for the HPPA, 3500@end ifset 3501@command{@value{AS}} can also generate whatever other named sections you 3502specify using the @samp{.space} and @samp{.subspace} directives. See 3503@cite{HP9000 Series 800 Assembly Language Reference Manual} 3504(HP 92432-90001) for details on the @samp{.space} and @samp{.subspace} 3505assembler directives. 3506 3507@ifset SOM 3508Additionally, @command{@value{AS}} uses different names for the standard 3509text, data, and bss sections when generating SOM output. Program text 3510is placed into the @samp{$CODE$} section, data into @samp{$DATA$}, and 3511BSS into @samp{$BSS$}. 3512@end ifset 3513@end ifset 3514 3515Within the object file, the text section starts at address @code{0}, the 3516data section follows, and the bss section follows the data section. 3517 3518@ifset HPPA 3519When generating either SOM or ELF output files on the HPPA, the text 3520section starts at address @code{0}, the data section at address 3521@code{0x4000000}, and the bss section follows the data section. 3522@end ifset 3523 3524To let @code{@value{LD}} know which data changes when the sections are 3525relocated, and how to change that data, @command{@value{AS}} also writes to the 3526object file details of the relocation needed. To perform relocation 3527@code{@value{LD}} must know, each time an address in the object 3528file is mentioned: 3529@itemize @bullet 3530@item 3531Where in the object file is the beginning of this reference to 3532an address? 3533@item 3534How long (in bytes) is this reference? 3535@item 3536Which section does the address refer to? What is the numeric value of 3537@display 3538(@var{address}) @minus{} (@var{start-address of section})? 3539@end display 3540@item 3541Is the reference to an address ``Program-Counter relative''? 3542@end itemize 3543 3544@cindex addresses, format of 3545@cindex section-relative addressing 3546In fact, every address @command{@value{AS}} ever uses is expressed as 3547@display 3548(@var{section}) + (@var{offset into section}) 3549@end display 3550@noindent 3551Further, most expressions @command{@value{AS}} computes have this section-relative 3552nature. 3553@ifset SOM 3554(For some object formats, such as SOM for the HPPA, some expressions are 3555symbol-relative instead.) 3556@end ifset 3557 3558In this manual we use the notation @{@var{secname} @var{N}@} to mean ``offset 3559@var{N} into section @var{secname}.'' 3560 3561Apart from text, data and bss sections you need to know about the 3562@dfn{absolute} section. When @code{@value{LD}} mixes partial programs, 3563addresses in the absolute section remain unchanged. For example, address 3564@code{@{absolute 0@}} is ``relocated'' to run-time address 0 by 3565@code{@value{LD}}. Although the linker never arranges two partial programs' 3566data sections with overlapping addresses after linking, @emph{by definition} 3567their absolute sections must overlap. Address @code{@{absolute@ 239@}} in one 3568part of a program is always the same address when the program is running as 3569address @code{@{absolute@ 239@}} in any other part of the program. 3570 3571The idea of sections is extended to the @dfn{undefined} section. Any 3572address whose section is unknown at assembly time is by definition 3573rendered @{undefined @var{U}@}---where @var{U} is filled in later. 3574Since numbers are always defined, the only way to generate an undefined 3575address is to mention an undefined symbol. A reference to a named 3576common block would be such a symbol: its value is unknown at assembly 3577time so it has section @emph{undefined}. 3578 3579By analogy the word @emph{section} is used to describe groups of sections in 3580the linked program. @code{@value{LD}} puts all partial programs' text 3581sections in contiguous addresses in the linked program. It is 3582customary to refer to the @emph{text section} of a program, meaning all 3583the addresses of all partial programs' text sections. Likewise for 3584data and bss sections. 3585 3586Some sections are manipulated by @code{@value{LD}}; others are invented for 3587use of @command{@value{AS}} and have no meaning except during assembly. 3588 3589@node Ld Sections 3590@section Linker Sections 3591@code{@value{LD}} deals with just four kinds of sections, summarized below. 3592 3593@table @strong 3594 3595@ifset COFF-ELF 3596@cindex named sections 3597@cindex sections, named 3598@item named sections 3599@end ifset 3600@ifset aout 3601@cindex text section 3602@cindex data section 3603@itemx text section 3604@itemx data section 3605@end ifset 3606These sections hold your program. @command{@value{AS}} and @code{@value{LD}} treat them as 3607separate but equal sections. Anything you can say of one section is 3608true of another. 3609@c @ifset aout 3610When the program is running, however, it is 3611customary for the text section to be unalterable. The 3612text section is often shared among processes: it contains 3613instructions, constants and the like. The data section of a running 3614program is usually alterable: for example, C variables would be stored 3615in the data section. 3616@c @end ifset 3617 3618@cindex bss section 3619@item bss section 3620This section contains zeroed bytes when your program begins running. It 3621is used to hold uninitialized variables or common storage. The length of 3622each partial program's bss section is important, but because it starts 3623out containing zeroed bytes there is no need to store explicit zero 3624bytes in the object file. The bss section was invented to eliminate 3625those explicit zeros from object files. 3626 3627@cindex absolute section 3628@item absolute section 3629Address 0 of this section is always ``relocated'' to runtime address 0. 3630This is useful if you want to refer to an address that @code{@value{LD}} must 3631not change when relocating. In this sense we speak of absolute 3632addresses being ``unrelocatable'': they do not change during relocation. 3633 3634@cindex undefined section 3635@item undefined section 3636This ``section'' is a catch-all for address references to objects not in 3637the preceding sections. 3638@c FIXME: ref to some other doc on obj-file formats could go here. 3639@end table 3640 3641@cindex relocation example 3642An idealized example of three relocatable sections follows. 3643@ifset COFF-ELF 3644The example uses the traditional section names @samp{.text} and @samp{.data}. 3645@end ifset 3646Memory addresses are on the horizontal axis. 3647 3648@c TEXI2ROFF-KILL 3649@ifnottex 3650@c END TEXI2ROFF-KILL 3651@smallexample 3652 +-----+----+--+ 3653partial program # 1: |ttttt|dddd|00| 3654 +-----+----+--+ 3655 3656 text data bss 3657 seg. seg. seg. 3658 3659 +---+---+---+ 3660partial program # 2: |TTT|DDD|000| 3661 +---+---+---+ 3662 3663 +--+---+-----+--+----+---+-----+~~ 3664linked program: | |TTT|ttttt| |dddd|DDD|00000| 3665 +--+---+-----+--+----+---+-----+~~ 3666 3667 addresses: 0 @dots{} 3668@end smallexample 3669@c TEXI2ROFF-KILL 3670@end ifnottex 3671@need 5000 3672@tex 3673\bigskip 3674\line{\it Partial program \#1: \hfil} 3675\line{\ibox{2.5cm}{\tt text}\ibox{2cm}{\tt data}\ibox{1cm}{\tt bss}\hfil} 3676\line{\boxit{2.5cm}{\tt ttttt}\boxit{2cm}{\tt dddd}\boxit{1cm}{\tt 00}\hfil} 3677 3678\line{\it Partial program \#2: \hfil} 3679\line{\ibox{1cm}{\tt text}\ibox{1.5cm}{\tt data}\ibox{1cm}{\tt bss}\hfil} 3680\line{\boxit{1cm}{\tt TTT}\boxit{1.5cm}{\tt DDDD}\boxit{1cm}{\tt 000}\hfil} 3681 3682\line{\it linked program: \hfil} 3683\line{\ibox{.5cm}{}\ibox{1cm}{\tt text}\ibox{2.5cm}{}\ibox{.75cm}{}\ibox{2cm}{\tt data}\ibox{1.5cm}{}\ibox{2cm}{\tt bss}\hfil} 3684\line{\boxit{.5cm}{}\boxit{1cm}{\tt TTT}\boxit{2.5cm}{\tt 3685ttttt}\boxit{.75cm}{}\boxit{2cm}{\tt dddd}\boxit{1.5cm}{\tt 3686DDDD}\boxit{2cm}{\tt 00000}\ \dots\hfil} 3687 3688\line{\it addresses: \hfil} 3689\line{0\dots\hfil} 3690 3691@end tex 3692@c END TEXI2ROFF-KILL 3693 3694@node As Sections 3695@section Assembler Internal Sections 3696 3697@cindex internal assembler sections 3698@cindex sections in messages, internal 3699These sections are meant only for the internal use of @command{@value{AS}}. They 3700have no meaning at run-time. You do not really need to know about these 3701sections for most purposes; but they can be mentioned in @command{@value{AS}} 3702warning messages, so it might be helpful to have an idea of their 3703meanings to @command{@value{AS}}. These sections are used to permit the 3704value of every expression in your assembly language program to be a 3705section-relative address. 3706 3707@table @b 3708@cindex assembler internal logic error 3709@item ASSEMBLER-INTERNAL-LOGIC-ERROR! 3710An internal assembler logic error has been found. This means there is a 3711bug in the assembler. 3712 3713@cindex expr (internal section) 3714@item expr section 3715The assembler stores complex expressions internally as combinations of 3716symbols. When it needs to represent an expression as a symbol, it puts 3717it in the expr section. 3718@c FIXME item debug 3719@c FIXME item transfer[t] vector preload 3720@c FIXME item transfer[t] vector postload 3721@c FIXME item register 3722@end table 3723 3724@node Sub-Sections 3725@section Sub-Sections 3726 3727@cindex numbered subsections 3728@cindex grouping data 3729@ifset aout 3730Assembled bytes 3731@ifset COFF-ELF 3732conventionally 3733@end ifset 3734fall into two sections: text and data. 3735@end ifset 3736You may have separate groups of 3737@ifset GENERIC 3738data in named sections 3739@end ifset 3740@ifclear GENERIC 3741@ifclear aout 3742data in named sections 3743@end ifclear 3744@ifset aout 3745text or data 3746@end ifset 3747@end ifclear 3748that you want to end up near to each other in the object file, even though they 3749are not contiguous in the assembler source. @command{@value{AS}} allows you to 3750use @dfn{subsections} for this purpose. Within each section, there can be 3751numbered subsections with values from 0 to 8192. Objects assembled into the 3752same subsection go into the object file together with other objects in the same 3753subsection. For example, a compiler might want to store constants in the text 3754section, but might not want to have them interspersed with the program being 3755assembled. In this case, the compiler could issue a @samp{.text 0} before each 3756section of code being output, and a @samp{.text 1} before each group of 3757constants being output. 3758 3759Subsections are optional. If you do not use subsections, everything 3760goes in subsection number zero. 3761 3762@ifset GENERIC 3763Each subsection is zero-padded up to a multiple of four bytes. 3764(Subsections may be padded a different amount on different flavors 3765of @command{@value{AS}}.) 3766@end ifset 3767@ifclear GENERIC 3768@ifset H8 3769On the H8/300 platform, each subsection is zero-padded to a word 3770boundary (two bytes). 3771The same is true on the Renesas SH. 3772@end ifset 3773@end ifclear 3774 3775Subsections appear in your object file in numeric order, lowest numbered 3776to highest. (All this to be compatible with other people's assemblers.) 3777The object file contains no representation of subsections; @code{@value{LD}} and 3778other programs that manipulate object files see no trace of them. 3779They just see all your text subsections as a text section, and all your 3780data subsections as a data section. 3781 3782To specify which subsection you want subsequent statements assembled 3783into, use a numeric argument to specify it, in a @samp{.text 3784@var{expression}} or a @samp{.data @var{expression}} statement. 3785@ifset COFF 3786@ifset GENERIC 3787When generating COFF output, you 3788@end ifset 3789@ifclear GENERIC 3790You 3791@end ifclear 3792can also use an extra subsection 3793argument with arbitrary named sections: @samp{.section @var{name}, 3794@var{expression}}. 3795@end ifset 3796@ifset ELF 3797@ifset GENERIC 3798When generating ELF output, you 3799@end ifset 3800@ifclear GENERIC 3801You 3802@end ifclear 3803can also use the @code{.subsection} directive (@pxref{SubSection}) 3804to specify a subsection: @samp{.subsection @var{expression}}. 3805@end ifset 3806@var{Expression} should be an absolute expression 3807(@pxref{Expressions}). If you just say @samp{.text} then @samp{.text 0} 3808is assumed. Likewise @samp{.data} means @samp{.data 0}. Assembly 3809begins in @code{text 0}. For instance: 3810@smallexample 3811.text 0 # The default subsection is text 0 anyway. 3812.ascii "This lives in the first text subsection. *" 3813.text 1 3814.ascii "But this lives in the second text subsection." 3815.data 0 3816.ascii "This lives in the data section," 3817.ascii "in the first data subsection." 3818.text 0 3819.ascii "This lives in the first text section," 3820.ascii "immediately following the asterisk (*)." 3821@end smallexample 3822 3823Each section has a @dfn{location counter} incremented by one for every byte 3824assembled into that section. Because subsections are merely a convenience 3825restricted to @command{@value{AS}} there is no concept of a subsection location 3826counter. There is no way to directly manipulate a location counter---but the 3827@code{.align} directive changes it, and any label definition captures its 3828current value. The location counter of the section where statements are being 3829assembled is said to be the @dfn{active} location counter. 3830 3831@node bss 3832@section bss Section 3833 3834@cindex bss section 3835@cindex common variable storage 3836The bss section is used for local common variable storage. 3837You may allocate address space in the bss section, but you may 3838not dictate data to load into it before your program executes. When 3839your program starts running, all the contents of the bss 3840section are zeroed bytes. 3841 3842The @code{.lcomm} pseudo-op defines a symbol in the bss section; see 3843@ref{Lcomm,,@code{.lcomm}}. 3844 3845The @code{.comm} pseudo-op may be used to declare a common symbol, which is 3846another form of uninitialized symbol; see @ref{Comm,,@code{.comm}}. 3847 3848@ifset GENERIC 3849When assembling for a target which supports multiple sections, such as ELF or 3850COFF, you may switch into the @code{.bss} section and define symbols as usual; 3851see @ref{Section,,@code{.section}}. You may only assemble zero values into the 3852section. Typically the section will only contain symbol definitions and 3853@code{.skip} directives (@pxref{Skip,,@code{.skip}}). 3854@end ifset 3855 3856@node Symbols 3857@chapter Symbols 3858 3859@cindex symbols 3860Symbols are a central concept: the programmer uses symbols to name 3861things, the linker uses symbols to link, and the debugger uses symbols 3862to debug. 3863 3864@quotation 3865@cindex debuggers, and symbol order 3866@emph{Warning:} @command{@value{AS}} does not place symbols in the object file in 3867the same order they were declared. This may break some debuggers. 3868@end quotation 3869 3870@menu 3871* Labels:: Labels 3872* Setting Symbols:: Giving Symbols Other Values 3873* Symbol Names:: Symbol Names 3874* Dot:: The Special Dot Symbol 3875* Symbol Attributes:: Symbol Attributes 3876@end menu 3877 3878@node Labels 3879@section Labels 3880 3881@cindex labels 3882A @dfn{label} is written as a symbol immediately followed by a colon 3883@samp{:}. The symbol then represents the current value of the 3884active location counter, and is, for example, a suitable instruction 3885operand. You are warned if you use the same symbol to represent two 3886different locations: the first definition overrides any other 3887definitions. 3888 3889@ifset HPPA 3890On the HPPA, the usual form for a label need not be immediately followed by a 3891colon, but instead must start in column zero. Only one label may be defined on 3892a single line. To work around this, the HPPA version of @command{@value{AS}} also 3893provides a special directive @code{.label} for defining labels more flexibly. 3894@end ifset 3895 3896@node Setting Symbols 3897@section Giving Symbols Other Values 3898 3899@cindex assigning values to symbols 3900@cindex symbol values, assigning 3901A symbol can be given an arbitrary value by writing a symbol, followed 3902by an equals sign @samp{=}, followed by an expression 3903(@pxref{Expressions}). This is equivalent to using the @code{.set} 3904directive. @xref{Set,,@code{.set}}. In the same way, using a double 3905equals sign @samp{=}@samp{=} here represents an equivalent of the 3906@code{.eqv} directive. @xref{Eqv,,@code{.eqv}}. 3907 3908@ifset Blackfin 3909Blackfin does not support symbol assignment with @samp{=}. 3910@end ifset 3911 3912@node Symbol Names 3913@section Symbol Names 3914 3915@cindex symbol names 3916@cindex names, symbol 3917@ifclear SPECIAL-SYMS 3918Symbol names begin with a letter or with one of @samp{._}. On most 3919machines, you can also use @code{$} in symbol names; exceptions are 3920noted in @ref{Machine Dependencies}. That character may be followed by any 3921string of digits, letters, dollar signs (unless otherwise noted for a 3922particular target machine), and underscores. These restrictions do not 3923apply when quoting symbol names by @samp{"}, which is permitted for most 3924targets. Escaping characters in quoted symbol names with @samp{\} generally 3925extends only to @samp{\} itself and @samp{"}, at the time of writing. 3926@end ifclear 3927@ifset SPECIAL-SYMS 3928@ifset H8 3929Symbol names begin with a letter or with one of @samp{._}. On the 3930Renesas SH you can also use @code{$} in symbol names. That 3931character may be followed by any string of digits, letters, dollar signs (save 3932on the H8/300), and underscores. 3933@end ifset 3934@end ifset 3935 3936Case of letters is significant: @code{foo} is a different symbol name 3937than @code{Foo}. 3938 3939Symbol names do not start with a digit. An exception to this rule is made for 3940Local Labels. See below. 3941 3942Multibyte characters are supported, but note that the setting of the 3943@option{multibyte-handling} option might prevent their use. 3944To generate a symbol name containing 3945multibyte characters enclose it within double quotes and use escape codes. cf 3946@xref{Strings}. Generating a multibyte symbol name from a label is not 3947currently supported. 3948 3949Since multibyte symbol names are unusual, and could possibly be used 3950maliciously, @command{@value{AS}} provides a command line option 3951(@option{--multibyte-handling=warn-sym-only}) which can be used to generate a 3952warning message whenever a symbol name containing multibyte characters is defined. 3953 3954Each symbol has exactly one name. Each name in an assembly language program 3955refers to exactly one symbol. You may use that symbol name any number of times 3956in a program. 3957 3958@subheading Local Symbol Names 3959 3960@cindex local symbol names 3961@cindex symbol names, local 3962A local symbol is any symbol beginning with certain local label prefixes. 3963By default, the local label prefix is @samp{.L} for ELF systems or 3964@samp{L} for traditional a.out systems, but each target may have its own 3965set of local label prefixes. 3966@ifset HPPA 3967On the HPPA local symbols begin with @samp{L$}. 3968@end ifset 3969 3970Local symbols are defined and used within the assembler, but they are 3971normally not saved in object files. Thus, they are not visible when debugging. 3972You may use the @samp{-L} option (@pxref{L, ,Include Local Symbols}) 3973to retain the local symbols in the object files. 3974 3975@subheading Local Labels 3976 3977@cindex local labels 3978@cindex temporary symbol names 3979@cindex symbol names, temporary 3980Local labels are different from local symbols. Local labels help compilers and 3981programmers use names temporarily. They create symbols which are guaranteed to 3982be unique over the entire scope of the input source code and which can be 3983referred to by a simple notation. To define a local label, write a label of 3984the form @samp{@b{N}:} (where @b{N} represents any non-negative integer). 3985To refer to the most recent previous definition of that label write 3986@samp{@b{N}b}, using the same number as when you defined the label. To refer 3987to the next definition of a local label, write @samp{@b{N}f}. The @samp{b} 3988stands for ``backwards'' and the @samp{f} stands for ``forwards''. 3989 3990There is no restriction on how you can use these labels, and you can reuse them 3991too. So that it is possible to repeatedly define the same local label (using 3992the same number @samp{@b{N}}), although you can only refer to the most recently 3993defined local label of that number (for a backwards reference) or the next 3994definition of a specific local label for a forward reference. It is also worth 3995noting that the first 10 local labels (@samp{@b{0:}}@dots{}@samp{@b{9:}}) are 3996implemented in a slightly more efficient manner than the others. 3997 3998Here is an example: 3999 4000@smallexample 40011: branch 1f 40022: branch 1b 40031: branch 2f 40042: branch 1b 4005@end smallexample 4006 4007Which is the equivalent of: 4008 4009@smallexample 4010label_1: branch label_3 4011label_2: branch label_1 4012label_3: branch label_4 4013label_4: branch label_3 4014@end smallexample 4015 4016Local label names are only a notational device. They are immediately 4017transformed into more conventional symbol names before the assembler uses them. 4018The symbol names are stored in the symbol table, appear in error messages, and 4019are optionally emitted to the object file. The names are constructed using 4020these parts: 4021 4022@table @code 4023@item @emph{local label prefix} 4024All local symbols begin with the system-specific local label prefix. 4025Normally both @command{@value{AS}} and @code{@value{LD}} forget symbols 4026that start with the local label prefix. These labels are 4027used for symbols you are never intended to see. If you use the 4028@samp{-L} option then @command{@value{AS}} retains these symbols in the 4029object file. If you also instruct @code{@value{LD}} to retain these symbols, 4030you may use them in debugging. 4031 4032@item @var{number} 4033This is the number that was used in the local label definition. So if the 4034label is written @samp{55:} then the number is @samp{55}. 4035 4036@item @kbd{C-B} 4037This unusual character is included so you do not accidentally invent a symbol 4038of the same name. The character has ASCII value of @samp{\002} (control-B). 4039 4040@item @emph{ordinal number} 4041This is a serial number to keep the labels distinct. The first definition of 4042@samp{0:} gets the number @samp{1}. The 15th definition of @samp{0:} gets the 4043number @samp{15}, and so on. Likewise the first definition of @samp{1:} gets 4044the number @samp{1} and its 15th definition gets @samp{15} as well. 4045@end table 4046 4047So for example, the first @code{1:} may be named @code{.L1@kbd{C-B}1}, and 4048the 44th @code{3:} may be named @code{.L3@kbd{C-B}44}. 4049 4050@subheading Dollar Local Labels 4051@cindex dollar local symbols 4052 4053On some targets @code{@value{AS}} also supports an even more local form of 4054local labels called dollar labels. These labels go out of scope (i.e., they 4055become undefined) as soon as a non-local label is defined. Thus they remain 4056valid for only a small region of the input source code. Normal local labels, 4057by contrast, remain in scope for the entire file, or until they are redefined 4058by another occurrence of the same local label. 4059 4060Dollar labels are defined in exactly the same way as ordinary local labels, 4061except that they have a dollar sign suffix to their numeric value, e.g., 4062@samp{@b{55$:}}. 4063 4064They can also be distinguished from ordinary local labels by their transformed 4065names which use ASCII character @samp{\001} (control-A) as the magic character 4066to distinguish them from ordinary labels. For example, the fifth definition of 4067@samp{6$} may be named @samp{.L6@kbd{C-A}5}. 4068 4069@node Dot 4070@section The Special Dot Symbol 4071 4072@cindex dot (symbol) 4073@cindex @code{.} (symbol) 4074@cindex current address 4075@cindex location counter 4076The special symbol @samp{.} refers to the current address that 4077@command{@value{AS}} is assembling into. Thus, the expression @samp{melvin: 4078.long .} defines @code{melvin} to contain its own address. 4079Assigning a value to @code{.} is treated the same as a @code{.org} 4080directive. 4081@ifclear no-space-dir 4082Thus, the expression @samp{.=.+4} is the same as saying 4083@samp{.space 4}. 4084@end ifclear 4085 4086@node Symbol Attributes 4087@section Symbol Attributes 4088 4089@cindex symbol attributes 4090@cindex attributes, symbol 4091Every symbol has, as well as its name, the attributes ``Value'' and 4092``Type''. Depending on output format, symbols can also have auxiliary 4093attributes. 4094@ifset INTERNALS 4095The detailed definitions are in @file{a.out.h}. 4096@end ifset 4097 4098If you use a symbol without defining it, @command{@value{AS}} assumes zero for 4099all these attributes, and probably won't warn you. This makes the 4100symbol an externally defined symbol, which is generally what you 4101would want. 4102 4103@menu 4104* Symbol Value:: Value 4105* Symbol Type:: Type 4106@ifset aout 4107* a.out Symbols:: Symbol Attributes: @code{a.out} 4108@end ifset 4109@ifset COFF 4110* COFF Symbols:: Symbol Attributes for COFF 4111@end ifset 4112@ifset SOM 4113* SOM Symbols:: Symbol Attributes for SOM 4114@end ifset 4115@end menu 4116 4117@node Symbol Value 4118@subsection Value 4119 4120@cindex value of a symbol 4121@cindex symbol value 4122The value of a symbol is (usually) 32 bits. For a symbol which labels a 4123location in the text, data, bss or absolute sections the value is the 4124number of addresses from the start of that section to the label. 4125Naturally for text, data and bss sections the value of a symbol changes 4126as @code{@value{LD}} changes section base addresses during linking. Absolute 4127symbols' values do not change during linking: that is why they are 4128called absolute. 4129 4130The value of an undefined symbol is treated in a special way. If it is 41310 then the symbol is not defined in this assembler source file, and 4132@code{@value{LD}} tries to determine its value from other files linked into the 4133same program. You make this kind of symbol simply by mentioning a symbol 4134name without defining it. A non-zero value represents a @code{.comm} 4135common declaration. The value is how much common storage to reserve, in 4136bytes (addresses). The symbol refers to the first address of the 4137allocated storage. 4138 4139@node Symbol Type 4140@subsection Type 4141 4142@cindex type of a symbol 4143@cindex symbol type 4144The type attribute of a symbol contains relocation (section) 4145information, any flag settings indicating that a symbol is external, and 4146(optionally), other information for linkers and debuggers. The exact 4147format depends on the object-code output format in use. 4148 4149@ifset aout 4150@node a.out Symbols 4151@subsection Symbol Attributes: @code{a.out} 4152 4153@cindex @code{a.out} symbol attributes 4154@cindex symbol attributes, @code{a.out} 4155 4156@menu 4157* Symbol Desc:: Descriptor 4158* Symbol Other:: Other 4159@end menu 4160 4161@node Symbol Desc 4162@subsubsection Descriptor 4163 4164@cindex descriptor, of @code{a.out} symbol 4165This is an arbitrary 16-bit value. You may establish a symbol's 4166descriptor value by using a @code{.desc} statement 4167(@pxref{Desc,,@code{.desc}}). A descriptor value means nothing to 4168@command{@value{AS}}. 4169 4170@node Symbol Other 4171@subsubsection Other 4172 4173@cindex other attribute, of @code{a.out} symbol 4174This is an arbitrary 8-bit value. It means nothing to @command{@value{AS}}. 4175@end ifset 4176 4177@ifset COFF 4178@node COFF Symbols 4179@subsection Symbol Attributes for COFF 4180 4181@cindex COFF symbol attributes 4182@cindex symbol attributes, COFF 4183 4184The COFF format supports a multitude of auxiliary symbol attributes; 4185like the primary symbol attributes, they are set between @code{.def} and 4186@code{.endef} directives. 4187 4188@subsubsection Primary Attributes 4189 4190@cindex primary attributes, COFF symbols 4191The symbol name is set with @code{.def}; the value and type, 4192respectively, with @code{.val} and @code{.type}. 4193 4194@subsubsection Auxiliary Attributes 4195 4196@cindex auxiliary attributes, COFF symbols 4197The @command{@value{AS}} directives @code{.dim}, @code{.line}, @code{.scl}, 4198@code{.size}, @code{.tag}, and @code{.weak} can generate auxiliary symbol 4199table information for COFF. 4200@end ifset 4201 4202@ifset SOM 4203@node SOM Symbols 4204@subsection Symbol Attributes for SOM 4205 4206@cindex SOM symbol attributes 4207@cindex symbol attributes, SOM 4208 4209The SOM format for the HPPA supports a multitude of symbol attributes set with 4210the @code{.EXPORT} and @code{.IMPORT} directives. 4211 4212The attributes are described in @cite{HP9000 Series 800 Assembly 4213Language Reference Manual} (HP 92432-90001) under the @code{IMPORT} and 4214@code{EXPORT} assembler directive documentation. 4215@end ifset 4216 4217@node Expressions 4218@chapter Expressions 4219 4220@cindex expressions 4221@cindex addresses 4222@cindex numeric values 4223An @dfn{expression} specifies an address or numeric value. 4224Whitespace may precede and/or follow an expression. 4225 4226The result of an expression must be an absolute number, or else an offset into 4227a particular section. If an expression is not absolute, and there is not 4228enough information when @command{@value{AS}} sees the expression to know its 4229section, a second pass over the source program might be necessary to interpret 4230the expression---but the second pass is currently not implemented. 4231@command{@value{AS}} aborts with an error message in this situation. 4232 4233@menu 4234* Empty Exprs:: Empty Expressions 4235* Integer Exprs:: Integer Expressions 4236@end menu 4237 4238@node Empty Exprs 4239@section Empty Expressions 4240 4241@cindex empty expressions 4242@cindex expressions, empty 4243An empty expression has no value: it is just whitespace or null. 4244Wherever an absolute expression is required, you may omit the 4245expression, and @command{@value{AS}} assumes a value of (absolute) 0. This 4246is compatible with other assemblers. 4247 4248@node Integer Exprs 4249@section Integer Expressions 4250 4251@cindex integer expressions 4252@cindex expressions, integer 4253An @dfn{integer expression} is one or more @emph{arguments} delimited 4254by @emph{operators}. 4255 4256@menu 4257* Arguments:: Arguments 4258* Operators:: Operators 4259* Prefix Ops:: Prefix Operators 4260* Infix Ops:: Infix Operators 4261@end menu 4262 4263@node Arguments 4264@subsection Arguments 4265 4266@cindex expression arguments 4267@cindex arguments in expressions 4268@cindex operands in expressions 4269@cindex arithmetic operands 4270@dfn{Arguments} are symbols, numbers or subexpressions. In other 4271contexts arguments are sometimes called ``arithmetic operands''. In 4272this manual, to avoid confusing them with the ``instruction operands'' of 4273the machine language, we use the term ``argument'' to refer to parts of 4274expressions only, reserving the word ``operand'' to refer only to machine 4275instruction operands. 4276 4277Symbols are evaluated to yield @{@var{section} @var{NNN}@} where 4278@var{section} is one of text, data, bss, absolute, 4279or undefined. @var{NNN} is a signed, 2's complement 32 bit 4280integer. 4281 4282Numbers are usually integers. 4283 4284A number can be a flonum or bignum. In this case, you are warned 4285that only the low order 32 bits are used, and @command{@value{AS}} pretends 4286these 32 bits are an integer. You may write integer-manipulating 4287instructions that act on exotic constants, compatible with other 4288assemblers. 4289 4290@cindex subexpressions 4291Subexpressions are a left parenthesis @samp{(} followed by an integer 4292expression, followed by a right parenthesis @samp{)}; or a prefix 4293operator followed by an argument. 4294 4295@node Operators 4296@subsection Operators 4297 4298@cindex operators, in expressions 4299@cindex arithmetic functions 4300@cindex functions, in expressions 4301@dfn{Operators} are arithmetic functions, like @code{+} or @code{%}. Prefix 4302operators are followed by an argument. Infix operators appear 4303between their arguments. Operators may be preceded and/or followed by 4304whitespace. 4305 4306@node Prefix Ops 4307@subsection Prefix Operator 4308 4309@cindex prefix operators 4310@command{@value{AS}} has the following @dfn{prefix operators}. They each take 4311one argument, which must be absolute. 4312 4313@c the tex/end tex stuff surrounding this small table is meant to make 4314@c it align, on the printed page, with the similar table in the next 4315@c section (which is inside an enumerate). 4316@tex 4317\global\advance\leftskip by \itemindent 4318@end tex 4319 4320@table @code 4321@item - 4322@dfn{Negation}. Two's complement negation. 4323@item ~ 4324@dfn{Complementation}. Bitwise not. 4325@end table 4326 4327@tex 4328\global\advance\leftskip by -\itemindent 4329@end tex 4330 4331@node Infix Ops 4332@subsection Infix Operators 4333 4334@cindex infix operators 4335@cindex operators, permitted arguments 4336@dfn{Infix operators} take two arguments, one on either side. Operators 4337have precedence, but operations with equal precedence are performed left 4338to right. Apart from @code{+} or @option{-}, both arguments must be 4339absolute, and the result is absolute. 4340 4341@enumerate 4342@cindex operator precedence 4343@cindex precedence of operators 4344 4345@item 4346Highest Precedence 4347 4348@table @code 4349@item * 4350@dfn{Multiplication}. 4351 4352@item / 4353@dfn{Division}. Truncation is the same as the C operator @samp{/} 4354 4355@item % 4356@dfn{Remainder}. 4357 4358@item << 4359@dfn{Shift Left}. Same as the C operator @samp{<<}. 4360 4361@item >> 4362@dfn{Shift Right}. Same as the C operator @samp{>>}. 4363@end table 4364 4365@item 4366Intermediate precedence 4367 4368@table @code 4369@item | 4370 4371@dfn{Bitwise Inclusive Or}. 4372 4373@item & 4374@dfn{Bitwise And}. 4375 4376@item ^ 4377@dfn{Bitwise Exclusive Or}. 4378 4379@item ! 4380@dfn{Bitwise Or Not}. 4381@end table 4382 4383@item 4384Low Precedence 4385 4386@table @code 4387@cindex addition, permitted arguments 4388@cindex plus, permitted arguments 4389@cindex arguments for addition 4390@item + 4391@dfn{Addition}. If either argument is absolute, the result has the section of 4392the other argument. You may not add together arguments from different 4393sections. 4394 4395@cindex subtraction, permitted arguments 4396@cindex minus, permitted arguments 4397@cindex arguments for subtraction 4398@item - 4399@dfn{Subtraction}. If the right argument is absolute, the 4400result has the section of the left argument. 4401If both arguments are in the same section, the result is absolute. 4402You may not subtract arguments from different sections. 4403@c FIXME is there still something useful to say about undefined - undefined ? 4404 4405@cindex comparison expressions 4406@cindex expressions, comparison 4407@item == 4408@dfn{Is Equal To} 4409@item <> 4410@itemx != 4411@dfn{Is Not Equal To} 4412@item < 4413@dfn{Is Less Than} 4414@item > 4415@dfn{Is Greater Than} 4416@item >= 4417@dfn{Is Greater Than Or Equal To} 4418@item <= 4419@dfn{Is Less Than Or Equal To} 4420 4421The comparison operators can be used as infix operators. A true result has a 4422value of -1 whereas a false result has a value of 0. Note, these operators 4423perform signed comparisons. 4424@end table 4425 4426@item Lowest Precedence 4427 4428@table @code 4429@item && 4430@dfn{Logical And}. 4431 4432@item || 4433@dfn{Logical Or}. 4434 4435These two logical operations can be used to combine the results of sub 4436expressions. Note, unlike the comparison operators a true result returns a 4437value of 1 but a false result does still return 0. Also note that the logical 4438or operator has a slightly lower precedence than logical and. 4439 4440@end table 4441@end enumerate 4442 4443In short, it's only meaningful to add or subtract the @emph{offsets} in an 4444address; you can only have a defined section in one of the two arguments. 4445 4446@node Pseudo Ops 4447@chapter Assembler Directives 4448 4449@cindex directives, machine independent 4450@cindex pseudo-ops, machine independent 4451@cindex machine independent directives 4452All assembler directives have names that begin with a period (@samp{.}). 4453The names are case insensitive for most targets, and usually written 4454in lower case. 4455 4456This chapter discusses directives that are available regardless of the 4457target machine configuration for the @sc{gnu} assembler. 4458@ifset GENERIC 4459Some machine configurations provide additional directives. 4460@xref{Machine Dependencies}. 4461@end ifset 4462@ifclear GENERIC 4463@ifset machine-directives 4464@xref{Machine Dependencies}, for additional directives. 4465@end ifset 4466@end ifclear 4467 4468@menu 4469* Abort:: @code{.abort} 4470@ifset COFF 4471* ABORT (COFF):: @code{.ABORT} 4472@end ifset 4473 4474* Align:: @code{.align [@var{abs-expr}[, @var{abs-expr}[, @var{abs-expr}]]]} 4475* Altmacro:: @code{.altmacro} 4476* Ascii:: @code{.ascii "@var{string}"}@dots{} 4477* Asciz:: @code{.asciz "@var{string}"}@dots{} 4478* Attach_to_group:: @code{.attach_to_group @var{name}} 4479* Balign:: @code{.balign [@var{abs-expr}[, @var{abs-expr}]]} 4480@ifset ELF 4481* Bss:: @code{.bss @var{subsection}} 4482@end ifset 4483@ifclear ELF 4484* Bss:: @code{.bss} 4485@end ifclear 4486* Bundle directives:: @code{.bundle_align_mode @var{abs-expr}}, etc 4487* Byte:: @code{.byte @var{expressions}} 4488* CFI directives:: @code{.cfi_startproc [simple]}, @code{.cfi_endproc}, etc. 4489* Comm:: @code{.comm @var{symbol} , @var{length} } 4490* Data:: @code{.data @var{subsection}} 4491* Dc:: @code{.dc[@var{size}] @var{expressions}} 4492* Dcb:: @code{.dcb[@var{size}] @var{number} [,@var{fill}]} 4493* Ds:: @code{.ds[@var{size}] @var{number} [,@var{fill}]} 4494@ifset COFF 4495* Def:: @code{.def @var{name}} 4496@end ifset 4497@ifset aout 4498* Desc:: @code{.desc @var{symbol}, @var{abs-expression}} 4499@end ifset 4500@ifset COFF 4501* Dim:: @code{.dim} 4502@end ifset 4503 4504* Double:: @code{.double @var{flonums}} 4505* Eject:: @code{.eject} 4506* Else:: @code{.else} 4507* Elseif:: @code{.elseif} 4508* End:: @code{.end} 4509@ifset COFF 4510* Endef:: @code{.endef} 4511@end ifset 4512 4513* Endfunc:: @code{.endfunc} 4514* Endif:: @code{.endif} 4515* Equ:: @code{.equ @var{symbol}, @var{expression}} 4516* Equiv:: @code{.equiv @var{symbol}, @var{expression}} 4517* Eqv:: @code{.eqv @var{symbol}, @var{expression}} 4518* Err:: @code{.err} 4519* Error:: @code{.error @var{string}} 4520* Exitm:: @code{.exitm} 4521* Extern:: @code{.extern} 4522* Fail:: @code{.fail} 4523* File:: @code{.file} 4524* Fill:: @code{.fill @var{repeat} , @var{size} , @var{value}} 4525* Float:: @code{.float @var{flonums}} 4526* Func:: @code{.func} 4527* Global:: @code{.global @var{symbol}}, @code{.globl @var{symbol}} 4528@ifset ELF 4529* Gnu_attribute:: @code{.gnu_attribute @var{tag},@var{value}} 4530* Hidden:: @code{.hidden @var{names}} 4531@end ifset 4532 4533* hword:: @code{.hword @var{expressions}} 4534* Ident:: @code{.ident} 4535* If:: @code{.if @var{absolute expression}} 4536* Incbin:: @code{.incbin "@var{file}"[,@var{skip}[,@var{count}]]} 4537* Include:: @code{.include "@var{file}"} 4538* Int:: @code{.int @var{expressions}} 4539@ifset ELF 4540* Internal:: @code{.internal @var{names}} 4541@end ifset 4542 4543* Irp:: @code{.irp @var{symbol},@var{values}}@dots{} 4544* Irpc:: @code{.irpc @var{symbol},@var{values}}@dots{} 4545* Lcomm:: @code{.lcomm @var{symbol} , @var{length}} 4546* Lflags:: @code{.lflags} 4547@ifclear no-line-dir 4548* Line:: @code{.line @var{line-number}} 4549@end ifclear 4550 4551* Linkonce:: @code{.linkonce [@var{type}]} 4552* List:: @code{.list} 4553* Ln:: @code{.ln @var{line-number}} 4554* Loc:: @code{.loc @var{fileno} @var{lineno}} 4555* Loc_mark_labels:: @code{.loc_mark_labels @var{enable}} 4556@ifset ELF 4557* Local:: @code{.local @var{names}} 4558@end ifset 4559 4560* Long:: @code{.long @var{expressions}} 4561@ignore 4562* Lsym:: @code{.lsym @var{symbol}, @var{expression}} 4563@end ignore 4564 4565* Macro:: @code{.macro @var{name} @var{args}}@dots{} 4566* MRI:: @code{.mri @var{val}} 4567* Noaltmacro:: @code{.noaltmacro} 4568* Nolist:: @code{.nolist} 4569* Nop:: @code{.nop} 4570* Nops:: @code{.nops @var{size}[, @var{control}]} 4571* Octa:: @code{.octa @var{bignums}} 4572* Offset:: @code{.offset @var{loc}} 4573* Org:: @code{.org @var{new-lc}, @var{fill}} 4574* P2align:: @code{.p2align [@var{abs-expr}[, @var{abs-expr}[, @var{abs-expr}]]]} 4575@ifset ELF 4576* PopSection:: @code{.popsection} 4577* Previous:: @code{.previous} 4578@end ifset 4579 4580* Print:: @code{.print @var{string}} 4581@ifset ELF 4582* Protected:: @code{.protected @var{names}} 4583@end ifset 4584 4585* Psize:: @code{.psize @var{lines}, @var{columns}} 4586* Purgem:: @code{.purgem @var{name}} 4587@ifset ELF 4588* PushSection:: @code{.pushsection @var{name}} 4589@end ifset 4590 4591* Quad:: @code{.quad @var{bignums}} 4592* Reloc:: @code{.reloc @var{offset}, @var{reloc_name}[, @var{expression}]} 4593* Rept:: @code{.rept @var{count}} 4594* Sbttl:: @code{.sbttl "@var{subheading}"} 4595@ifset COFF 4596* Scl:: @code{.scl @var{class}} 4597@end ifset 4598@ifset COFF-ELF 4599* Section:: @code{.section @var{name}[, @var{flags}]} 4600@end ifset 4601 4602* Set:: @code{.set @var{symbol}, @var{expression}} 4603* Short:: @code{.short @var{expressions}} 4604* Single:: @code{.single @var{flonums}} 4605@ifset COFF-ELF 4606* Size:: @code{.size [@var{name} , @var{expression}]} 4607@end ifset 4608@ifclear no-space-dir 4609* Skip:: @code{.skip @var{size} [,@var{fill}]} 4610@end ifclear 4611 4612* Sleb128:: @code{.sleb128 @var{expressions}} 4613@ifclear no-space-dir 4614* Space:: @code{.space @var{size} [,@var{fill}]} 4615@end ifclear 4616@ifset have-stabs 4617* Stab:: @code{.stabd, .stabn, .stabs} 4618@end ifset 4619 4620* String:: @code{.string "@var{str}"}, @code{.string8 "@var{str}"}, @code{.string16 "@var{str}"}, @code{.string32 "@var{str}"}, @code{.string64 "@var{str}"} 4621* Struct:: @code{.struct @var{expression}} 4622@ifset ELF 4623* SubSection:: @code{.subsection} 4624* Symver:: @code{.symver @var{name},@var{name2@@nodename}[,@var{visibility}]} 4625@end ifset 4626 4627@ifset COFF 4628* Tag:: @code{.tag @var{structname}} 4629@end ifset 4630 4631* Text:: @code{.text @var{subsection}} 4632* Title:: @code{.title "@var{heading}"} 4633@ifset ELF 4634* Tls_common:: @code{.tls_common @var{symbol}, @var{length}[, @var{alignment}]} 4635@end ifset 4636@ifset COFF-ELF 4637* Type:: @code{.type <@var{int} | @var{name} , @var{type description}>} 4638@end ifset 4639 4640* Uleb128:: @code{.uleb128 @var{expressions}} 4641@ifset COFF 4642* Val:: @code{.val @var{addr}} 4643@end ifset 4644 4645@ifset ELF 4646* Version:: @code{.version "@var{string}"} 4647* VTableEntry:: @code{.vtable_entry @var{table}, @var{offset}} 4648* VTableInherit:: @code{.vtable_inherit @var{child}, @var{parent}} 4649@end ifset 4650 4651* Warning:: @code{.warning @var{string}} 4652* Weak:: @code{.weak @var{names}} 4653* Weakref:: @code{.weakref @var{alias}, @var{symbol}} 4654* Word:: @code{.word @var{expressions}} 4655@ifclear no-space-dir 4656* Zero:: @code{.zero @var{size}} 4657@end ifclear 4658* 2byte:: @code{.2byte @var{expressions}} 4659* 4byte:: @code{.4byte @var{expressions}} 4660* 8byte:: @code{.8byte @var{expressions}} 4661* Deprecated:: Deprecated Directives 4662@end menu 4663 4664@node Abort 4665@section @code{.abort} 4666 4667@cindex @code{abort} directive 4668@cindex stopping the assembly 4669This directive stops the assembly immediately. It is for 4670compatibility with other assemblers. The original idea was that the 4671assembly language source would be piped into the assembler. If the sender 4672of the source quit, it could use this directive tells @command{@value{AS}} to 4673quit also. One day @code{.abort} will not be supported. 4674 4675@ifset COFF 4676@node ABORT (COFF) 4677@section @code{.ABORT} (COFF) 4678 4679@cindex @code{ABORT} directive 4680When producing COFF output, @command{@value{AS}} accepts this directive as a 4681synonym for @samp{.abort}. 4682 4683@end ifset 4684 4685@node Align 4686@section @code{.align [@var{abs-expr}[, @var{abs-expr}[, @var{abs-expr}]]]} 4687 4688@cindex padding the location counter 4689@cindex @code{align} directive 4690Pad the location counter (in the current subsection) to a particular storage 4691boundary. The first expression (which must be absolute) is the alignment 4692required, as described below. If this expression is omitted then a default 4693value of 0 is used, effectively disabling alignment requirements. 4694 4695The second expression (also absolute) gives the fill value to be stored in the 4696padding bytes. It (and the comma) may be omitted. If it is omitted, the 4697padding bytes are normally zero. However, on most systems, if the section is 4698marked as containing code and the fill value is omitted, the space is filled 4699with no-op instructions. 4700 4701The third expression is also absolute, and is also optional. If it is present, 4702it is the maximum number of bytes that should be skipped by this alignment 4703directive. If doing the alignment would require skipping more bytes than the 4704specified maximum, then the alignment is not done at all. You can omit the 4705fill value (the second argument) entirely by simply using two commas after the 4706required alignment; this can be useful if you want the alignment to be filled 4707with no-op instructions when appropriate. 4708 4709The way the required alignment is specified varies from system to system. 4710For the arc, hppa, i386 using ELF, iq2000, m68k, or1k, 4711s390, sparc, tic4x and xtensa, the first expression is the 4712alignment request in bytes. For example @samp{.align 8} advances 4713the location counter until it is a multiple of 8. If the location counter 4714is already a multiple of 8, no change is needed. For the tic54x, the 4715first expression is the alignment request in words. 4716 4717For other systems, including ppc, i386 using a.out format, arm and 4718strongarm, it is the 4719number of low-order zero bits the location counter must have after 4720advancement. For example @samp{.align 3} advances the location 4721counter until it is a multiple of 8. If the location counter is already a 4722multiple of 8, no change is needed. 4723 4724This inconsistency is due to the different behaviors of the various 4725native assemblers for these systems which GAS must emulate. 4726GAS also provides @code{.balign} and @code{.p2align} directives, 4727described later, which have a consistent behavior across all 4728architectures (but are specific to GAS). 4729 4730@node Altmacro 4731@section @code{.altmacro} 4732Enable alternate macro mode, enabling: 4733 4734@ftable @code 4735@item LOCAL @var{name} [ , @dots{} ] 4736One additional directive, @code{LOCAL}, is available. It is used to 4737generate a string replacement for each of the @var{name} arguments, and 4738replace any instances of @var{name} in each macro expansion. The 4739replacement string is unique in the assembly, and different for each 4740separate macro expansion. @code{LOCAL} allows you to write macros that 4741define symbols, without fear of conflict between separate macro expansions. 4742 4743@item String delimiters 4744You can write strings delimited in these other ways besides 4745@code{"@var{string}"}: 4746 4747@table @code 4748@item '@var{string}' 4749You can delimit strings with single-quote characters. 4750 4751@item <@var{string}> 4752You can delimit strings with matching angle brackets. 4753@end table 4754 4755@item single-character string escape 4756To include any single character literally in a string (even if the 4757character would otherwise have some special meaning), you can prefix the 4758character with @samp{!} (an exclamation mark). For example, you can 4759write @samp{<4.3 !> 5.4!!>} to get the literal text @samp{4.3 > 5.4!}. 4760 4761@item Expression results as strings 4762You can write @samp{%@var{expr}} to evaluate the expression @var{expr} 4763and use the result as a string. 4764@end ftable 4765 4766@node Ascii 4767@section @code{.ascii "@var{string}"}@dots{} 4768 4769@cindex @code{ascii} directive 4770@cindex string literals 4771@code{.ascii} expects zero or more string literals (@pxref{Strings}) 4772separated by commas. It assembles each string (with no automatic 4773trailing zero byte) into consecutive addresses. 4774 4775@node Asciz 4776@section @code{.asciz "@var{string}"}@dots{} 4777 4778@cindex @code{asciz} directive 4779@cindex zero-terminated strings 4780@cindex null-terminated strings 4781@code{.asciz} is just like @code{.ascii}, but each string is followed by 4782a zero byte. The ``z'' in @samp{.asciz} stands for ``zero''. Note that 4783multiple string arguments not separated by commas will be concatenated 4784together and only one final zero byte will be stored. 4785 4786@node Attach_to_group 4787@section @code{.attach_to_group @var{name}} 4788Attaches the current section to the named group. This is like declaring 4789the section with the @code{G} attribute, but can be done after the section 4790has been created. Note if the group section does not exist at the point that 4791this directive is used then it will be created. 4792 4793@node Balign 4794@section @code{.balign[wl] [@var{abs-expr}[, @var{abs-expr}[, @var{abs-expr}]]]} 4795 4796@cindex padding the location counter given number of bytes 4797@cindex @code{balign} directive 4798Pad the location counter (in the current subsection) to a particular 4799storage boundary. The first expression (which must be absolute) is the 4800alignment request in bytes. For example @samp{.balign 8} advances 4801the location counter until it is a multiple of 8. If the location counter 4802is already a multiple of 8, no change is needed. If the expression is omitted 4803then a default value of 0 is used, effectively disabling alignment requirements. 4804 4805The second expression (also absolute) gives the fill value to be stored in the 4806padding bytes. It (and the comma) may be omitted. If it is omitted, the 4807padding bytes are normally zero. However, on most systems, if the section is 4808marked as containing code and the fill value is omitted, the space is filled 4809with no-op instructions. 4810 4811The third expression is also absolute, and is also optional. If it is present, 4812it is the maximum number of bytes that should be skipped by this alignment 4813directive. If doing the alignment would require skipping more bytes than the 4814specified maximum, then the alignment is not done at all. You can omit the 4815fill value (the second argument) entirely by simply using two commas after the 4816required alignment; this can be useful if you want the alignment to be filled 4817with no-op instructions when appropriate. 4818 4819@cindex @code{balignw} directive 4820@cindex @code{balignl} directive 4821The @code{.balignw} and @code{.balignl} directives are variants of the 4822@code{.balign} directive. The @code{.balignw} directive treats the fill 4823pattern as a two byte word value. The @code{.balignl} directives treats the 4824fill pattern as a four byte longword value. For example, @code{.balignw 48254,0x368d} will align to a multiple of 4. If it skips two bytes, they will be 4826filled in with the value 0x368d (the exact placement of the bytes depends upon 4827the endianness of the processor). If it skips 1 or 3 bytes, the fill value is 4828undefined. 4829 4830@ifset ELF 4831@node Bss 4832@section @code{.bss @var{subsection}} 4833@end ifset 4834@ifclear ELF 4835@node Bss 4836@section @code{.bss} 4837@end ifclear 4838@cindex @code{bss} directive 4839 4840@code{.bss} tells @command{@value{AS}} to assemble the following statements 4841onto the end of the bss section. 4842@ifset ELF 4843For most ELF based targets an optional @var{subsection} expression (which must 4844evaluate to a positive integer) can be provided. In this case the statements 4845are appended to the end of the indicated bss subsection. 4846@end ifset 4847 4848@node Bundle directives 4849@section Bundle directives 4850@subsection @code{.bundle_align_mode @var{abs-expr}} 4851@cindex @code{bundle_align_mode} directive 4852@cindex bundle 4853@cindex instruction bundle 4854@cindex aligned instruction bundle 4855@code{.bundle_align_mode} enables or disables @dfn{aligned instruction 4856bundle} mode. In this mode, sequences of adjacent instructions are grouped 4857into fixed-sized @dfn{bundles}. If the argument is zero, this mode is 4858disabled (which is the default state). If the argument it not zero, it 4859gives the size of an instruction bundle as a power of two (as for the 4860@code{.p2align} directive, @pxref{P2align}). 4861 4862For some targets, it's an ABI requirement that no instruction may span a 4863certain aligned boundary. A @dfn{bundle} is simply a sequence of 4864instructions that starts on an aligned boundary. For example, if 4865@var{abs-expr} is @code{5} then the bundle size is 32, so each aligned 4866chunk of 32 bytes is a bundle. When aligned instruction bundle mode is in 4867effect, no single instruction may span a boundary between bundles. If an 4868instruction would start too close to the end of a bundle for the length of 4869that particular instruction to fit within the bundle, then the space at the 4870end of that bundle is filled with no-op instructions so the instruction 4871starts in the next bundle. As a corollary, it's an error if any single 4872instruction's encoding is longer than the bundle size. 4873 4874@subsection @code{.bundle_lock} and @code{.bundle_unlock} 4875@cindex @code{bundle_lock} directive 4876@cindex @code{bundle_unlock} directive 4877The @code{.bundle_lock} and directive @code{.bundle_unlock} directives 4878allow explicit control over instruction bundle padding. These directives 4879are only valid when @code{.bundle_align_mode} has been used to enable 4880aligned instruction bundle mode. It's an error if they appear when 4881@code{.bundle_align_mode} has not been used at all, or when the last 4882directive was @w{@code{.bundle_align_mode 0}}. 4883 4884@cindex bundle-locked 4885For some targets, it's an ABI requirement that certain instructions may 4886appear only as part of specified permissible sequences of multiple 4887instructions, all within the same bundle. A pair of @code{.bundle_lock} 4888and @code{.bundle_unlock} directives define a @dfn{bundle-locked} 4889instruction sequence. For purposes of aligned instruction bundle mode, a 4890sequence starting with @code{.bundle_lock} and ending with 4891@code{.bundle_unlock} is treated as a single instruction. That is, the 4892entire sequence must fit into a single bundle and may not span a bundle 4893boundary. If necessary, no-op instructions will be inserted before the 4894first instruction of the sequence so that the whole sequence starts on an 4895aligned bundle boundary. It's an error if the sequence is longer than the 4896bundle size. 4897 4898For convenience when using @code{.bundle_lock} and @code{.bundle_unlock} 4899inside assembler macros (@pxref{Macro}), bundle-locked sequences may be 4900nested. That is, a second @code{.bundle_lock} directive before the next 4901@code{.bundle_unlock} directive has no effect except that it must be 4902matched by another closing @code{.bundle_unlock} so that there is the 4903same number of @code{.bundle_lock} and @code{.bundle_unlock} directives. 4904 4905@node Byte 4906@section @code{.byte @var{expressions}} 4907 4908@cindex @code{byte} directive 4909@cindex integers, one byte 4910@code{.byte} expects zero or more expressions, separated by commas. 4911Each expression is assembled into the next byte. 4912 4913Note - this directive is not intended for encoding instructions, and it will 4914not trigger effects like DWARF line number generation. Instead some targets 4915support special directives for encoding arbitrary binary sequences as 4916instructions such as @code{.insn} or @code{.inst}. 4917 4918@node CFI directives 4919@section CFI directives 4920@subsection @code{.cfi_sections @var{section_list}} 4921@cindex @code{cfi_sections} directive 4922@code{.cfi_sections} may be used to specify whether CFI directives 4923should emit @code{.eh_frame} section, @code{.debug_frame} section and/or 4924@code{.sframe} section. If @var{section_list} contains @code{.eh_frame}, 4925@code{.eh_frame} is emitted, if @var{section_list} contains 4926@code{.debug_frame}, @code{.debug_frame} is emitted, and finally, if 4927@var{section_list} contains @code{.sframe}, @code{.sframe} is emitted. 4928To emit multiple sections, specify them together in a list. For example, to 4929emit both @code{.eh_frame} and @code{.debug_frame}, use 4930@code{.eh_frame, .debug_frame}. The default if this directive is not used 4931is @code{.cfi_sections .eh_frame}. 4932 4933On targets that support compact unwinding tables these can be generated 4934by specifying @code{.eh_frame_entry} instead of @code{.eh_frame}. 4935 4936Some targets may support an additional name, such as @code{.c6xabi.exidx} 4937which is used by the @value{TIC6X} target. 4938 4939The @code{.cfi_sections} directive can be repeated, with the same or different 4940arguments, provided that CFI generation has not yet started. Once CFI 4941generation has started however the section list is fixed and any attempts to 4942redefine it will result in an error. 4943 4944@subsection @code{.cfi_startproc [simple]} 4945@cindex @code{cfi_startproc} directive 4946@code{.cfi_startproc} is used at the beginning of each function that 4947should have an entry in @code{.eh_frame}. It initializes some internal 4948data structures. Don't forget to close the function by 4949@code{.cfi_endproc}. 4950 4951Unless @code{.cfi_startproc} is used along with parameter @code{simple} 4952it also emits some architecture dependent initial CFI instructions. 4953 4954@subsection @code{.cfi_endproc} 4955@cindex @code{cfi_endproc} directive 4956@code{.cfi_endproc} is used at the end of a function where it closes its 4957unwind entry previously opened by 4958@code{.cfi_startproc}, and emits it to @code{.eh_frame}. 4959 4960@subsection @code{.cfi_personality @var{encoding} [, @var{exp}]} 4961@cindex @code{cfi_personality} directive 4962@code{.cfi_personality} defines personality routine and its encoding. 4963@var{encoding} must be a constant determining how the personality 4964should be encoded. If it is 255 (@code{DW_EH_PE_omit}), second 4965argument is not present, otherwise second argument should be 4966a constant or a symbol name. When using indirect encodings, 4967the symbol provided should be the location where personality 4968can be loaded from, not the personality routine itself. 4969The default after @code{.cfi_startproc} is @code{.cfi_personality 0xff}, 4970no personality routine. 4971 4972@subsection @code{.cfi_personality_id @var{id}} 4973@cindex @code{cfi_personality_id} directive 4974@code{cfi_personality_id} defines a personality routine by its index as 4975defined in a compact unwinding format. 4976Only valid when generating compact EH frames (i.e. 4977with @code{.cfi_sections eh_frame_entry}. 4978 4979@subsection @code{.cfi_fde_data [@var{opcode1} [, @dots{}]]} 4980@cindex @code{cfi_fde_data} directive 4981@code{cfi_fde_data} is used to describe the compact unwind opcodes to be 4982used for the current function. These are emitted inline in the 4983@code{.eh_frame_entry} section if small enough and there is no LSDA, or 4984in the @code{.gnu.extab} section otherwise. 4985Only valid when generating compact EH frames (i.e. 4986with @code{.cfi_sections eh_frame_entry}. 4987 4988@subsection @code{.cfi_lsda @var{encoding} [, @var{exp}]} 4989@code{.cfi_lsda} defines LSDA and its encoding. 4990@var{encoding} must be a constant determining how the LSDA 4991should be encoded. If it is 255 (@code{DW_EH_PE_omit}), the second 4992argument is not present, otherwise the second argument should be a constant 4993or a symbol name. The default after @code{.cfi_startproc} is @code{.cfi_lsda 0xff}, 4994meaning that no LSDA is present. 4995 4996@subsection @code{.cfi_inline_lsda} [@var{align}] 4997@code{.cfi_inline_lsda} marks the start of a LSDA data section and 4998switches to the corresponding @code{.gnu.extab} section. 4999Must be preceded by a CFI block containing a @code{.cfi_lsda} directive. 5000Only valid when generating compact EH frames (i.e. 5001with @code{.cfi_sections eh_frame_entry}. 5002 5003The table header and unwinding opcodes will be generated at this point, 5004so that they are immediately followed by the LSDA data. The symbol 5005referenced by the @code{.cfi_lsda} directive should still be defined 5006in case a fallback FDE based encoding is used. The LSDA data is terminated 5007by a section directive. 5008 5009The optional @var{align} argument specifies the alignment required. 5010The alignment is specified as a power of two, as with the 5011@code{.p2align} directive. 5012 5013@subsection @code{.cfi_def_cfa @var{register}, @var{offset}} 5014@code{.cfi_def_cfa} defines a rule for computing CFA as: @i{take 5015address from @var{register} and add @var{offset} to it}. 5016 5017@subsection @code{.cfi_def_cfa_register @var{register}} 5018@code{.cfi_def_cfa_register} modifies a rule for computing CFA. From 5019now on @var{register} will be used instead of the old one. Offset 5020remains the same. 5021 5022@subsection @code{.cfi_def_cfa_offset @var{offset}} 5023@code{.cfi_def_cfa_offset} modifies a rule for computing CFA. Register 5024remains the same, but @var{offset} is new. Note that it is the 5025absolute offset that will be added to a defined register to compute 5026CFA address. 5027 5028@subsection @code{.cfi_adjust_cfa_offset @var{offset}} 5029Same as @code{.cfi_def_cfa_offset} but @var{offset} is a relative 5030value that is added/subtracted from the previous offset. 5031 5032@subsection @code{.cfi_offset @var{register}, @var{offset}} 5033Previous value of @var{register} is saved at offset @var{offset} from 5034CFA. 5035 5036@subsection @code{.cfi_val_offset @var{register}, @var{offset}} 5037Previous value of @var{register} is CFA + @var{offset}. 5038 5039@subsection @code{.cfi_rel_offset @var{register}, @var{offset}} 5040Previous value of @var{register} is saved at offset @var{offset} from 5041the current CFA register. This is transformed to @code{.cfi_offset} 5042using the known displacement of the CFA register from the CFA. 5043This is often easier to use, because the number will match the 5044code it's annotating. 5045 5046@subsection @code{.cfi_register @var{register1}, @var{register2}} 5047Previous value of @var{register1} is saved in register @var{register2}. 5048 5049@subsection @code{.cfi_restore @var{register}} 5050@code{.cfi_restore} says that the rule for @var{register} is now the 5051same as it was at the beginning of the function, after all initial 5052instruction added by @code{.cfi_startproc} were executed. 5053 5054@subsection @code{.cfi_undefined @var{register}} 5055From now on the previous value of @var{register} can't be restored anymore. 5056 5057@subsection @code{.cfi_same_value @var{register}} 5058Current value of @var{register} is the same like in the previous frame, 5059i.e. no restoration needed. 5060 5061@subsection @code{.cfi_remember_state} and @code{.cfi_restore_state} 5062@code{.cfi_remember_state} pushes the set of rules for every register onto an 5063implicit stack, while @code{.cfi_restore_state} pops them off the stack and 5064places them in the current row. This is useful for situations where you have 5065multiple @code{.cfi_*} directives that need to be undone due to the control 5066flow of the program. For example, we could have something like this (assuming 5067the CFA is the value of @code{rbp}): 5068 5069@smallexample 5070 je label 5071 popq %rbx 5072 .cfi_restore %rbx 5073 popq %r12 5074 .cfi_restore %r12 5075 popq %rbp 5076 .cfi_restore %rbp 5077 .cfi_def_cfa %rsp, 8 5078 ret 5079label: 5080 /* Do something else */ 5081@end smallexample 5082 5083Here, we want the @code{.cfi} directives to affect only the rows corresponding 5084to the instructions before @code{label}. This means we'd have to add multiple 5085@code{.cfi} directives after @code{label} to recreate the original save 5086locations of the registers, as well as setting the CFA back to the value of 5087@code{rbp}. This would be clumsy, and result in a larger binary size. Instead, 5088we can write: 5089 5090@smallexample 5091 je label 5092 popq %rbx 5093 .cfi_remember_state 5094 .cfi_restore %rbx 5095 popq %r12 5096 .cfi_restore %r12 5097 popq %rbp 5098 .cfi_restore %rbp 5099 .cfi_def_cfa %rsp, 8 5100 ret 5101label: 5102 .cfi_restore_state 5103 /* Do something else */ 5104@end smallexample 5105 5106That way, the rules for the instructions after @code{label} will be the same 5107as before the first @code{.cfi_restore} without having to use multiple 5108@code{.cfi} directives. 5109 5110@subsection @code{.cfi_return_column @var{register}} 5111Change return column @var{register}, i.e. the return address is either 5112directly in @var{register} or can be accessed by rules for @var{register}. 5113 5114@subsection @code{.cfi_signal_frame} 5115Mark current function as signal trampoline. 5116 5117@subsection @code{.cfi_window_save} 5118SPARC register window has been saved. 5119 5120@subsection @code{.cfi_escape} @var{expression}[, @dots{}] 5121Allows the user to add arbitrary bytes to the unwind info. One 5122might use this to add OS-specific CFI opcodes, or generic CFI 5123opcodes that GAS does not yet support. 5124 5125@subsection @code{.cfi_val_encoded_addr @var{register}, @var{encoding}, @var{label}} 5126The current value of @var{register} is @var{label}. The value of @var{label} 5127will be encoded in the output file according to @var{encoding}; see the 5128description of @code{.cfi_personality} for details on this encoding. 5129 5130The usefulness of equating a register to a fixed label is probably 5131limited to the return address register. Here, it can be useful to 5132mark a code segment that has only one return address which is reached 5133by a direct branch and no copy of the return address exists in memory 5134or another register. 5135 5136@node Comm 5137@section @code{.comm @var{symbol} , @var{length} } 5138 5139@cindex @code{comm} directive 5140@cindex symbol, common 5141@code{.comm} declares a common symbol named @var{symbol}. When linking, a 5142common symbol in one object file may be merged with a defined or common symbol 5143of the same name in another object file. If @code{@value{LD}} does not see a 5144definition for the symbol--just one or more common symbols--then it will 5145allocate @var{length} bytes of uninitialized memory. @var{length} must be an 5146absolute expression. If @code{@value{LD}} sees multiple common symbols with 5147the same name, and they do not all have the same size, it will allocate space 5148using the largest size. 5149 5150@ifset COFF-ELF 5151When using ELF or (as a GNU extension) PE, the @code{.comm} directive takes 5152an optional third argument. This is the desired alignment of the symbol, 5153specified for ELF as a byte boundary (for example, an alignment of 16 means 5154that the least significant 4 bits of the address should be zero), and for PE 5155as a power of two (for example, an alignment of 5 means aligned to a 32-byte 5156boundary). The alignment must be an absolute expression, and it must be a 5157power of two. If @code{@value{LD}} allocates uninitialized memory for the 5158common symbol, it will use the alignment when placing the symbol. If no 5159alignment is specified, @command{@value{AS}} will set the alignment to the 5160largest power of two less than or equal to the size of the symbol, up to a 5161maximum of 16 on ELF, or the default section alignment of 4 on PE@footnote{This 5162is not the same as the executable image file alignment controlled by @code{@value{LD}}'s 5163@samp{--section-alignment} option; image file sections in PE are aligned to 5164multiples of 4096, which is far too large an alignment for ordinary variables. 5165It is rather the default alignment for (non-debug) sections within object 5166(@samp{*.o}) files, which are less strictly aligned.}. 5167@end ifset 5168 5169@ifset HPPA 5170The syntax for @code{.comm} differs slightly on the HPPA. The syntax is 5171@samp{@var{symbol} .comm, @var{length}}; @var{symbol} is optional. 5172@end ifset 5173 5174@node Data 5175@section @code{.data @var{subsection}} 5176@cindex @code{data} directive 5177 5178@code{.data} tells @command{@value{AS}} to assemble the following statements onto the 5179end of the data subsection numbered @var{subsection} (which is an 5180absolute expression). If @var{subsection} is omitted, it defaults 5181to zero. 5182 5183@node Dc 5184@section @code{.dc[@var{size}] @var{expressions}} 5185@cindex @code{dc} directive 5186 5187The @code{.dc} directive expects zero or more @var{expressions} separated by 5188commas. These expressions are evaluated and their values inserted into the 5189current section. The size of the emitted value depends upon the suffix to the 5190@code{.dc} directive: 5191 5192@table @code 5193@item @samp{.a} 5194Emits N-bit values, where N is the size of an address on the target system. 5195@item @samp{.b} 5196Emits 8-bit values. 5197@item @samp{.d} 5198Emits double precision floating-point values. 5199@item @samp{.l} 5200Emits 32-bit values. 5201@item @samp{.s} 5202Emits single precision floating-point values. 5203@item @samp{.w} 5204Emits 16-bit values. 5205Note - this is true even on targets where the @code{.word} directive would emit 520632-bit values. 5207@item @samp{.x} 5208Emits long double precision floating-point values. 5209@end table 5210 5211If no suffix is used then @samp{.w} is assumed. 5212 5213The byte ordering is target dependent, as is the size and format of floating 5214point values. 5215 5216Note - these directives are not intended for encoding instructions, and they 5217will not trigger effects like DWARF line number generation. Instead some 5218targets support special directives for encoding arbitrary binary sequences as 5219instructions such as @code{.insn} or @code{.inst}. 5220 5221@node Dcb 5222@section @code{.dcb[@var{size}] @var{number} [,@var{fill}]} 5223@cindex @code{dcb} directive 5224This directive emits @var{number} copies of @var{fill}, each of @var{size} 5225bytes. Both @var{number} and @var{fill} are absolute expressions. If the 5226comma and @var{fill} are omitted, @var{fill} is assumed to be zero. The 5227@var{size} suffix, if present, must be one of: 5228 5229@table @code 5230@item @samp{.b} 5231Emits single byte values. 5232@item @samp{.d} 5233Emits double-precision floating point values. 5234@item @samp{.l} 5235Emits 4-byte values. 5236@item @samp{.s} 5237Emits single-precision floating point values. 5238@item @samp{.w} 5239Emits 2-byte values. 5240@item @samp{.x} 5241Emits long double-precision floating point values. 5242@end table 5243 5244If the @var{size} suffix is omitted then @samp{.w} is assumed. 5245 5246The byte ordering is target dependent, as is the size and format of floating 5247point values. 5248 5249@node Ds 5250@section @code{.ds[@var{size}] @var{number} [,@var{fill}]} 5251@cindex @code{ds} directive 5252This directive emits @var{number} copies of @var{fill}, each of @var{size} 5253bytes. Both @var{number} and @var{fill} are absolute expressions. If the 5254comma and @var{fill} are omitted, @var{fill} is assumed to be zero. The 5255@var{size} suffix, if present, must be one of: 5256 5257@table @code 5258@item @samp{.b} 5259Emits single byte values. 5260@item @samp{.d} 5261Emits 8-byte values. 5262@item @samp{.l} 5263Emits 4-byte values. 5264@item @samp{.p} 5265Emits values with size matching packed-decimal floating-point ones. 5266@item @samp{.s} 5267Emits 4-byte values. 5268@item @samp{.w} 5269Emits 2-byte values. 5270@item @samp{.x} 5271Emits values with size matching long double precision floating-point ones. 5272@end table 5273 5274Note - unlike the @code{.dcb} directive the @samp{.d}, @samp{.s} and @samp{.x} 5275suffixes do not indicate that floating-point values are to be inserted. 5276 5277If the @var{size} suffix is omitted then @samp{.w} is assumed. 5278 5279The byte ordering is target dependent. 5280 5281@ifset COFF 5282@node Def 5283@section @code{.def @var{name}} 5284 5285@cindex @code{def} directive 5286@cindex COFF symbols, debugging 5287@cindex debugging COFF symbols 5288Begin defining debugging information for a symbol @var{name}; the 5289definition extends until the @code{.endef} directive is encountered. 5290@end ifset 5291 5292@ifset aout 5293@node Desc 5294@section @code{.desc @var{symbol}, @var{abs-expression}} 5295 5296@cindex @code{desc} directive 5297@cindex COFF symbol descriptor 5298@cindex symbol descriptor, COFF 5299This directive sets the descriptor of the symbol (@pxref{Symbol Attributes}) 5300to the low 16 bits of an absolute expression. 5301 5302@ifset COFF 5303The @samp{.desc} directive is not available when @command{@value{AS}} is 5304configured for COFF output; it is only for @code{a.out} or @code{b.out} 5305object format. For the sake of compatibility, @command{@value{AS}} accepts 5306it, but produces no output, when configured for COFF. 5307@end ifset 5308@end ifset 5309 5310@ifset COFF 5311@node Dim 5312@section @code{.dim} 5313 5314@cindex @code{dim} directive 5315@cindex COFF auxiliary symbol information 5316@cindex auxiliary symbol information, COFF 5317This directive is generated by compilers to include auxiliary debugging 5318information in the symbol table. It is only permitted inside 5319@code{.def}/@code{.endef} pairs. 5320@end ifset 5321 5322@node Double 5323@section @code{.double @var{flonums}} 5324 5325@cindex @code{double} directive 5326@cindex floating point numbers (double) 5327@code{.double} expects zero or more flonums, separated by commas. It 5328assembles floating point numbers. 5329@ifset GENERIC 5330The exact kind of floating point numbers emitted depends on how 5331@command{@value{AS}} is configured. @xref{Machine Dependencies}. 5332@end ifset 5333@ifclear GENERIC 5334@ifset IEEEFLOAT 5335On the @value{TARGET} family @samp{.double} emits 64-bit floating-point numbers 5336in @sc{ieee} format. 5337@end ifset 5338@end ifclear 5339 5340@node Eject 5341@section @code{.eject} 5342 5343@cindex @code{eject} directive 5344@cindex new page, in listings 5345@cindex page, in listings 5346@cindex listing control: new page 5347Force a page break at this point, when generating assembly listings. 5348 5349@node Else 5350@section @code{.else} 5351 5352@cindex @code{else} directive 5353@code{.else} is part of the @command{@value{AS}} support for conditional 5354assembly; see @ref{If,,@code{.if}}. It marks the beginning of a section 5355of code to be assembled if the condition for the preceding @code{.if} 5356was false. 5357 5358@node Elseif 5359@section @code{.elseif} 5360 5361@cindex @code{elseif} directive 5362@code{.elseif} is part of the @command{@value{AS}} support for conditional 5363assembly; see @ref{If,,@code{.if}}. It is shorthand for beginning a new 5364@code{.if} block that would otherwise fill the entire @code{.else} section. 5365 5366@node End 5367@section @code{.end} 5368 5369@cindex @code{end} directive 5370@code{.end} marks the end of the assembly file. @command{@value{AS}} does not 5371process anything in the file past the @code{.end} directive. 5372 5373@ifset COFF 5374@node Endef 5375@section @code{.endef} 5376 5377@cindex @code{endef} directive 5378This directive flags the end of a symbol definition begun with 5379@code{.def}. 5380@end ifset 5381 5382@node Endfunc 5383@section @code{.endfunc} 5384@cindex @code{endfunc} directive 5385@code{.endfunc} marks the end of a function specified with @code{.func}. 5386 5387@node Endif 5388@section @code{.endif} 5389 5390@cindex @code{endif} directive 5391@code{.endif} is part of the @command{@value{AS}} support for conditional assembly; 5392it marks the end of a block of code that is only assembled 5393conditionally. @xref{If,,@code{.if}}. 5394 5395@node Equ 5396@section @code{.equ @var{symbol}, @var{expression}} 5397 5398@cindex @code{equ} directive 5399@cindex assigning values to symbols 5400@cindex symbols, assigning values to 5401This directive sets the value of @var{symbol} to @var{expression}. 5402It is synonymous with @samp{.set}; see @ref{Set,,@code{.set}}. 5403 5404@ifset HPPA 5405The syntax for @code{equ} on the HPPA is 5406@samp{@var{symbol} .equ @var{expression}}. 5407@end ifset 5408 5409@ifset Z80 5410The syntax for @code{equ} on the Z80 is 5411@samp{@var{symbol} equ @var{expression}}. 5412On the Z80 it is an error if @var{symbol} is already defined, 5413but the symbol is not protected from later redefinition. 5414Compare @ref{Equiv}. 5415@end ifset 5416 5417@node Equiv 5418@section @code{.equiv @var{symbol}, @var{expression}} 5419@cindex @code{equiv} directive 5420The @code{.equiv} directive is like @code{.equ} and @code{.set}, except that 5421the assembler will signal an error if @var{symbol} is already defined. Note a 5422symbol which has been referenced but not actually defined is considered to be 5423undefined. 5424 5425Except for the contents of the error message, this is roughly equivalent to 5426@smallexample 5427.ifdef SYM 5428.err 5429.endif 5430.equ SYM,VAL 5431@end smallexample 5432plus it protects the symbol from later redefinition. 5433 5434@node Eqv 5435@section @code{.eqv @var{symbol}, @var{expression}} 5436@cindex @code{eqv} directive 5437The @code{.eqv} directive is like @code{.equiv}, but no attempt is made to 5438evaluate the expression or any part of it immediately. Instead each time 5439the resulting symbol is used in an expression, a snapshot of its current 5440value is taken. 5441 5442@node Err 5443@section @code{.err} 5444@cindex @code{err} directive 5445If @command{@value{AS}} assembles a @code{.err} directive, it will print an error 5446message and, unless the @option{-Z} option was used, it will not generate an 5447object file. This can be used to signal an error in conditionally compiled code. 5448 5449@node Error 5450@section @code{.error "@var{string}"} 5451@cindex error directive 5452 5453Similarly to @code{.err}, this directive emits an error, but you can specify a 5454string that will be emitted as the error message. If you don't specify the 5455message, it defaults to @code{".error directive invoked in source file"}. 5456@xref{Errors, ,Error and Warning Messages}. 5457 5458@smallexample 5459 .error "This code has not been assembled and tested." 5460@end smallexample 5461 5462@node Exitm 5463@section @code{.exitm} 5464Exit early from the current macro definition. @xref{Macro}. 5465 5466@node Extern 5467@section @code{.extern} 5468 5469@cindex @code{extern} directive 5470@code{.extern} is accepted in the source program---for compatibility 5471with other assemblers---but it is ignored. @command{@value{AS}} treats 5472all undefined symbols as external. 5473 5474@node Fail 5475@section @code{.fail @var{expression}} 5476 5477@cindex @code{fail} directive 5478Generates an error or a warning. If the value of the @var{expression} is 500 5479or more, @command{@value{AS}} will print a warning message. If the value is less 5480than 500, @command{@value{AS}} will print an error message. The message will 5481include the value of @var{expression}. This can occasionally be useful inside 5482complex nested macros or conditional assembly. 5483 5484@node File 5485@section @code{.file} 5486@cindex @code{file} directive 5487 5488@ifclear no-file-dir 5489There are two different versions of the @code{.file} directive. Targets 5490that support DWARF2 line number information use the DWARF2 version of 5491@code{.file}. Other targets use the default version. 5492 5493@subheading Default Version 5494 5495@cindex logical file name 5496@cindex file name, logical 5497This version of the @code{.file} directive tells @command{@value{AS}} that we 5498are about to start a new logical file. The syntax is: 5499 5500@smallexample 5501.file @var{string} 5502@end smallexample 5503 5504@var{string} is the new file name. In general, the filename is 5505recognized whether or not it is surrounded by quotes @samp{"}; but if you wish 5506to specify an empty file name, you must give the quotes--@code{""}. This 5507statement may go away in future: it is only recognized to be compatible with 5508old @command{@value{AS}} programs. 5509 5510@subheading DWARF2 Version 5511@end ifclear 5512 5513When emitting DWARF2 line number information, @code{.file} assigns filenames 5514to the @code{.debug_line} file name table. The syntax is: 5515 5516@smallexample 5517.file @var{fileno} @var{filename} 5518@end smallexample 5519 5520The @var{fileno} operand should be a unique positive integer to use as the 5521index of the entry in the table. The @var{filename} operand is a C string 5522literal enclosed in double quotes. The @var{filename} can include directory 5523elements. If it does, then the directory will be added to the directory table 5524and the basename will be added to the file table. 5525 5526The detail of filename indices is exposed to the user because the filename 5527table is shared with the @code{.debug_info} section of the DWARF2 debugging 5528information, and thus the user must know the exact indices that table 5529entries will have. 5530 5531If DWARF5 support has been enabled via the @option{-gdwarf-5} option then 5532an extended version of @code{.file} is also allowed: 5533 5534@smallexample 5535.file @var{fileno} [@var{dirname}] @var{filename} [md5 @var{value}] 5536@end smallexample 5537 5538With this version a separate directory name is allowed, although if this is 5539used then @var{filename} should not contain any directory component, except 5540for @var{fileno} equal to 0: in this case, @var{dirname} is expected to be 5541the current directory and @var{filename} the currently processed file, and 5542the latter need not be located in the former. In addition an MD5 hash value 5543of the contents of @var{filename} can be provided. This will be stored in 5544the the file table as well, and can be used by tools reading the debug 5545information to verify that the contents of the source file match the 5546contents of the compiled file. 5547 5548@node Fill 5549@section @code{.fill @var{repeat} , @var{size} , @var{value}} 5550 5551@cindex @code{fill} directive 5552@cindex writing patterns in memory 5553@cindex patterns, writing in memory 5554@var{repeat}, @var{size} and @var{value} are absolute expressions. 5555This emits @var{repeat} copies of @var{size} bytes. @var{Repeat} 5556may be zero or more. @var{Size} may be zero or more, but if it is 5557more than 8, then it is deemed to have the value 8, compatible with 5558other people's assemblers. The contents of each @var{repeat} bytes 5559is taken from an 8-byte number. The highest order 4 bytes are 5560zero. The lowest order 4 bytes are @var{value} rendered in the 5561byte-order of an integer on the computer @command{@value{AS}} is assembling for. 5562Each @var{size} bytes in a repetition is taken from the lowest order 5563@var{size} bytes of this number. Again, this bizarre behavior is 5564compatible with other people's assemblers. 5565 5566@var{size} and @var{value} are optional. 5567If the second comma and @var{value} are absent, @var{value} is 5568assumed zero. If the first comma and following tokens are absent, 5569@var{size} is assumed to be 1. 5570 5571@node Float 5572@section @code{.float @var{flonums}} 5573 5574@cindex floating point numbers (single) 5575@cindex @code{float} directive 5576This directive assembles zero or more flonums, separated by commas. It 5577has the same effect as @code{.single}. 5578@ifset GENERIC 5579The exact kind of floating point numbers emitted depends on how 5580@command{@value{AS}} is configured. 5581@xref{Machine Dependencies}. 5582@end ifset 5583@ifclear GENERIC 5584@ifset IEEEFLOAT 5585On the @value{TARGET} family, @code{.float} emits 32-bit floating point numbers 5586in @sc{ieee} format. 5587@end ifset 5588@end ifclear 5589 5590@node Func 5591@section @code{.func @var{name}[,@var{label}]} 5592@cindex @code{func} directive 5593@code{.func} emits debugging information to denote function @var{name}, and 5594is ignored unless the file is assembled with debugging enabled. 5595Only @samp{--gstabs[+]} is currently supported. 5596@var{label} is the entry point of the function and if omitted @var{name} 5597prepended with the @samp{leading char} is used. 5598@samp{leading char} is usually @code{_} or nothing, depending on the target. 5599All functions are currently defined to have @code{void} return type. 5600The function must be terminated with @code{.endfunc}. 5601 5602@node Global 5603@section @code{.global @var{symbol}}, @code{.globl @var{symbol}} 5604 5605@cindex @code{global} directive 5606@cindex symbol, making visible to linker 5607@code{.global} makes the symbol visible to @code{@value{LD}}. If you define 5608@var{symbol} in your partial program, its value is made available to 5609other partial programs that are linked with it. Otherwise, 5610@var{symbol} takes its attributes from a symbol of the same name 5611from another file linked into the same program. 5612 5613Both spellings (@samp{.globl} and @samp{.global}) are accepted, for 5614compatibility with other assemblers. 5615 5616@ifset HPPA 5617On the HPPA, @code{.global} is not always enough to make it accessible to other 5618partial programs. You may need the HPPA-only @code{.EXPORT} directive as well. 5619@xref{HPPA Directives, ,HPPA Assembler Directives}. 5620@end ifset 5621 5622@ifset ELF 5623@node Gnu_attribute 5624@section @code{.gnu_attribute @var{tag},@var{value}} 5625Record a @sc{gnu} object attribute for this file. @xref{Object Attributes}. 5626 5627@node Hidden 5628@section @code{.hidden @var{names}} 5629 5630@cindex @code{hidden} directive 5631@cindex visibility 5632This is one of the ELF visibility directives. The other two are 5633@code{.internal} (@pxref{Internal,,@code{.internal}}) and 5634@code{.protected} (@pxref{Protected,,@code{.protected}}). 5635 5636This directive overrides the named symbols default visibility (which is set by 5637their binding: local, global or weak). The directive sets the visibility to 5638@code{hidden} which means that the symbols are not visible to other components. 5639Such symbols are always considered to be @code{protected} as well. 5640@end ifset 5641 5642@node hword 5643@section @code{.hword @var{expressions}} 5644 5645@cindex @code{hword} directive 5646@cindex integers, 16-bit 5647@cindex numbers, 16-bit 5648@cindex sixteen bit integers 5649This expects zero or more @var{expressions}, and emits 5650a 16 bit number for each. 5651 5652@ifset GENERIC 5653This directive is a synonym for @samp{.short}; depending on the target 5654architecture, it may also be a synonym for @samp{.word}. 5655@end ifset 5656@ifclear GENERIC 5657@ifset W32 5658This directive is a synonym for @samp{.short}. 5659@end ifset 5660@ifset W16 5661This directive is a synonym for both @samp{.short} and @samp{.word}. 5662@end ifset 5663@end ifclear 5664 5665@node Ident 5666@section @code{.ident} 5667 5668@cindex @code{ident} directive 5669 5670This directive is used by some assemblers to place tags in object files. The 5671behavior of this directive varies depending on the target. When using the 5672a.out object file format, @command{@value{AS}} simply accepts the directive for 5673source-file compatibility with existing assemblers, but does not emit anything 5674for it. When using COFF, comments are emitted to the @code{.comment} or 5675@code{.rdata} section, depending on the target. When using ELF, comments are 5676emitted to the @code{.comment} section. 5677 5678@node If 5679@section @code{.if @var{absolute expression}} 5680 5681@cindex conditional assembly 5682@cindex @code{if} directive 5683@code{.if} marks the beginning of a section of code which is only 5684considered part of the source program being assembled if the argument 5685(which must be an @var{absolute expression}) is non-zero. The end of 5686the conditional section of code must be marked by @code{.endif} 5687(@pxref{Endif,,@code{.endif}}); optionally, you may include code for the 5688alternative condition, flagged by @code{.else} (@pxref{Else,,@code{.else}}). 5689If you have several conditions to check, @code{.elseif} may be used to avoid 5690nesting blocks if/else within each subsequent @code{.else} block. 5691 5692The following variants of @code{.if} are also supported: 5693@table @code 5694@cindex @code{ifdef} directive 5695@item .ifdef @var{symbol} 5696Assembles the following section of code if the specified @var{symbol} 5697has been defined. Note a symbol which has been referenced but not yet defined 5698is considered to be undefined. 5699 5700@cindex @code{ifb} directive 5701@item .ifb @var{text} 5702Assembles the following section of code if the operand is blank (empty). 5703 5704@cindex @code{ifc} directive 5705@item .ifc @var{string1},@var{string2} 5706Assembles the following section of code if the two strings are the same. The 5707strings may be optionally quoted with single quotes. If they are not quoted, 5708the first string stops at the first comma, and the second string stops at the 5709end of the line. Strings which contain whitespace should be quoted. The 5710string comparison is case sensitive. 5711 5712@cindex @code{ifeq} directive 5713@item .ifeq @var{absolute expression} 5714Assembles the following section of code if the argument is zero. 5715 5716@cindex @code{ifeqs} directive 5717@item .ifeqs @var{string1},@var{string2} 5718Another form of @code{.ifc}. The strings must be quoted using double quotes. 5719 5720@cindex @code{ifge} directive 5721@item .ifge @var{absolute expression} 5722Assembles the following section of code if the argument is greater than or 5723equal to zero. 5724 5725@cindex @code{ifgt} directive 5726@item .ifgt @var{absolute expression} 5727Assembles the following section of code if the argument is greater than zero. 5728 5729@cindex @code{ifle} directive 5730@item .ifle @var{absolute expression} 5731Assembles the following section of code if the argument is less than or equal 5732to zero. 5733 5734@cindex @code{iflt} directive 5735@item .iflt @var{absolute expression} 5736Assembles the following section of code if the argument is less than zero. 5737 5738@cindex @code{ifnb} directive 5739@item .ifnb @var{text} 5740Like @code{.ifb}, but the sense of the test is reversed: this assembles the 5741following section of code if the operand is non-blank (non-empty). 5742 5743@cindex @code{ifnc} directive 5744@item .ifnc @var{string1},@var{string2}. 5745Like @code{.ifc}, but the sense of the test is reversed: this assembles the 5746following section of code if the two strings are not the same. 5747 5748@cindex @code{ifndef} directive 5749@cindex @code{ifnotdef} directive 5750@item .ifndef @var{symbol} 5751@itemx .ifnotdef @var{symbol} 5752Assembles the following section of code if the specified @var{symbol} 5753has not been defined. Both spelling variants are equivalent. Note a symbol 5754which has been referenced but not yet defined is considered to be undefined. 5755 5756@cindex @code{ifne} directive 5757@item .ifne @var{absolute expression} 5758Assembles the following section of code if the argument is not equal to zero 5759(in other words, this is equivalent to @code{.if}). 5760 5761@cindex @code{ifnes} directive 5762@item .ifnes @var{string1},@var{string2} 5763Like @code{.ifeqs}, but the sense of the test is reversed: this assembles the 5764following section of code if the two strings are not the same. 5765@end table 5766 5767@node Incbin 5768@section @code{.incbin "@var{file}"[,@var{skip}[,@var{count}]]} 5769 5770@cindex @code{incbin} directive 5771@cindex binary files, including 5772The @code{incbin} directive includes @var{file} verbatim at the current 5773location. You can control the search paths used with the @samp{-I} command-line 5774option (@pxref{Invoking,,Command-Line Options}). Quotation marks are required 5775around @var{file}. 5776 5777The @var{skip} argument skips a number of bytes from the start of the 5778@var{file}. The @var{count} argument indicates the maximum number of bytes to 5779read. Note that the data is not aligned in any way, so it is the user's 5780responsibility to make sure that proper alignment is provided both before and 5781after the @code{incbin} directive. 5782 5783@node Include 5784@section @code{.include "@var{file}"} 5785 5786@cindex @code{include} directive 5787@cindex supporting files, including 5788@cindex files, including 5789This directive provides a way to include supporting files at specified 5790points in your source program. The code from @var{file} is assembled as 5791if it followed the point of the @code{.include}; when the end of the 5792included file is reached, assembly of the original file continues. You 5793can control the search paths used with the @samp{-I} command-line option 5794(@pxref{Invoking,,Command-Line Options}). Quotation marks are required 5795around @var{file}. 5796 5797@node Int 5798@section @code{.int @var{expressions}} 5799 5800@cindex @code{int} directive 5801@cindex integers, 32-bit 5802Expect zero or more @var{expressions}, of any section, separated by commas. 5803For each expression, emit a number that, at run time, is the value of that 5804expression. The byte order and bit size of the number depends on what kind 5805of target the assembly is for. 5806 5807@ifclear GENERIC 5808@ifset H8 5809On most forms of the H8/300, @code{.int} emits 16-bit 5810integers. On the H8/300H and the Renesas SH, however, @code{.int} emits 581132-bit integers. 5812@end ifset 5813@end ifclear 5814 5815Note - this directive is not intended for encoding instructions, and it will 5816not trigger effects like DWARF line number generation. Instead some targets 5817support special directives for encoding arbitrary binary sequences as 5818instructions such as eg @code{.insn} or @code{.inst}. 5819 5820@ifset ELF 5821@node Internal 5822@section @code{.internal @var{names}} 5823 5824@cindex @code{internal} directive 5825@cindex visibility 5826This is one of the ELF visibility directives. The other two are 5827@code{.hidden} (@pxref{Hidden,,@code{.hidden}}) and 5828@code{.protected} (@pxref{Protected,,@code{.protected}}). 5829 5830This directive overrides the named symbols default visibility (which is set by 5831their binding: local, global or weak). The directive sets the visibility to 5832@code{internal} which means that the symbols are considered to be @code{hidden} 5833(i.e., not visible to other components), and that some extra, processor specific 5834processing must also be performed upon the symbols as well. 5835@end ifset 5836 5837@node Irp 5838@section @code{.irp @var{symbol},@var{values}}@dots{} 5839 5840@cindex @code{irp} directive 5841Evaluate a sequence of statements assigning different values to @var{symbol}. 5842The sequence of statements starts at the @code{.irp} directive, and is 5843terminated by an @code{.endr} directive. For each @var{value}, @var{symbol} is 5844set to @var{value}, and the sequence of statements is assembled. If no 5845@var{value} is listed, the sequence of statements is assembled once, with 5846@var{symbol} set to the null string. To refer to @var{symbol} within the 5847sequence of statements, use @var{\symbol}. 5848 5849For example, assembling 5850 5851@example 5852 .irp param,1,2,3 5853 move d\param,sp@@- 5854 .endr 5855@end example 5856 5857is equivalent to assembling 5858 5859@example 5860 move d1,sp@@- 5861 move d2,sp@@- 5862 move d3,sp@@- 5863@end example 5864 5865For some caveats with the spelling of @var{symbol}, see also @ref{Macro}. 5866 5867@node Irpc 5868@section @code{.irpc @var{symbol},@var{values}}@dots{} 5869 5870@cindex @code{irpc} directive 5871Evaluate a sequence of statements assigning different values to @var{symbol}. 5872The sequence of statements starts at the @code{.irpc} directive, and is 5873terminated by an @code{.endr} directive. For each character in @var{value}, 5874@var{symbol} is set to the character, and the sequence of statements is 5875assembled. If no @var{value} is listed, the sequence of statements is 5876assembled once, with @var{symbol} set to the null string. To refer to 5877@var{symbol} within the sequence of statements, use @var{\symbol}. 5878 5879For example, assembling 5880 5881@example 5882 .irpc param,123 5883 move d\param,sp@@- 5884 .endr 5885@end example 5886 5887is equivalent to assembling 5888 5889@example 5890 move d1,sp@@- 5891 move d2,sp@@- 5892 move d3,sp@@- 5893@end example 5894 5895For some caveats with the spelling of @var{symbol}, see also the discussion 5896at @xref{Macro}. 5897 5898@node Lcomm 5899@section @code{.lcomm @var{symbol} , @var{length}} 5900 5901@cindex @code{lcomm} directive 5902@cindex local common symbols 5903@cindex symbols, local common 5904Reserve @var{length} (an absolute expression) bytes for a local common 5905denoted by @var{symbol}. The section and value of @var{symbol} are 5906those of the new local common. The addresses are allocated in the bss 5907section, so that at run-time the bytes start off zeroed. @var{Symbol} 5908is not declared global (@pxref{Global,,@code{.global}}), so is normally 5909not visible to @code{@value{LD}}. 5910 5911@ifset GENERIC 5912Some targets permit a third argument to be used with @code{.lcomm}. This 5913argument specifies the desired alignment of the symbol in the bss section. 5914@end ifset 5915 5916@ifset HPPA 5917The syntax for @code{.lcomm} differs slightly on the HPPA. The syntax is 5918@samp{@var{symbol} .lcomm, @var{length}}; @var{symbol} is optional. 5919@end ifset 5920 5921@node Lflags 5922@section @code{.lflags} 5923 5924@cindex @code{lflags} directive (ignored) 5925@command{@value{AS}} accepts this directive, for compatibility with other 5926assemblers, but ignores it. 5927 5928@ifclear no-line-dir 5929@node Line 5930@section @code{.line @var{line-number}} 5931 5932@cindex @code{line} directive 5933@cindex logical line number 5934@ifset aout 5935Change the logical line number. @var{line-number} must be an absolute 5936expression. The next line has that logical line number. Therefore any other 5937statements on the current line (after a statement separator character) are 5938reported as on logical line number @var{line-number} @minus{} 1. One day 5939@command{@value{AS}} will no longer support this directive: it is recognized only 5940for compatibility with existing assembler programs. 5941@end ifset 5942 5943Even though this is a directive associated with the @code{a.out} or 5944@code{b.out} object-code formats, @command{@value{AS}} still recognizes it 5945when producing COFF output, and treats @samp{.line} as though it 5946were the COFF @samp{.ln} @emph{if} it is found outside a 5947@code{.def}/@code{.endef} pair. 5948 5949Inside a @code{.def}, @samp{.line} is, instead, one of the directives 5950used by compilers to generate auxiliary symbol information for 5951debugging. 5952@end ifclear 5953 5954@node Linkonce 5955@section @code{.linkonce [@var{type}]} 5956@cindex COMDAT 5957@cindex @code{linkonce} directive 5958@cindex common sections 5959Mark the current section so that the linker only includes a single copy of it. 5960This may be used to include the same section in several different object files, 5961but ensure that the linker will only include it once in the final output file. 5962The @code{.linkonce} pseudo-op must be used for each instance of the section. 5963Duplicate sections are detected based on the section name, so it should be 5964unique. 5965 5966This directive is only supported by a few object file formats; as of this 5967writing, the only object file format which supports it is the Portable 5968Executable format used on Windows NT. 5969 5970The @var{type} argument is optional. If specified, it must be one of the 5971following strings. For example: 5972@smallexample 5973.linkonce same_size 5974@end smallexample 5975Not all types may be supported on all object file formats. 5976 5977@table @code 5978@item discard 5979Silently discard duplicate sections. This is the default. 5980 5981@item one_only 5982Warn if there are duplicate sections, but still keep only one copy. 5983 5984@item same_size 5985Warn if any of the duplicates have different sizes. 5986 5987@item same_contents 5988Warn if any of the duplicates do not have exactly the same contents. 5989@end table 5990 5991@node List 5992@section @code{.list} 5993 5994@cindex @code{list} directive 5995@cindex listing control, turning on 5996Control (in conjunction with the @code{.nolist} directive) whether or 5997not assembly listings are generated. These two directives maintain an 5998internal counter (which is zero initially). @code{.list} increments the 5999counter, and @code{.nolist} decrements it. Assembly listings are 6000generated whenever the counter is greater than zero. 6001 6002By default, listings are disabled. When you enable them (with the 6003@samp{-a} command-line option; @pxref{Invoking,,Command-Line Options}), 6004the initial value of the listing counter is one. 6005 6006@node Ln 6007@section @code{.ln @var{line-number}} 6008 6009@cindex @code{ln} directive 6010@ifclear no-line-dir 6011@samp{.ln} is a synonym for @samp{.line}. 6012@end ifclear 6013@ifset no-line-dir 6014Tell @command{@value{AS}} to change the logical line number. @var{line-number} 6015must be an absolute expression. The next line has that logical 6016line number, so any other statements on the current line (after a 6017statement separator character @code{;}) are reported as on logical 6018line number @var{line-number} @minus{} 1. 6019@end ifset 6020 6021@node Loc 6022@section @code{.loc @var{fileno} @var{lineno} [@var{column}] [@var{options}]} 6023@cindex @code{loc} directive 6024When emitting DWARF2 line number information, 6025the @code{.loc} directive will add a row to the @code{.debug_line} line 6026number matrix corresponding to the immediately following assembly 6027instruction. The @var{fileno}, @var{lineno}, and optional @var{column} 6028arguments will be applied to the @code{.debug_line} state machine before 6029the row is added. It is an error for the input assembly file to generate 6030a non-empty @code{.debug_line} and also use @code{loc} directives. 6031 6032The @var{options} are a sequence of the following tokens in any order: 6033 6034@table @code 6035@item basic_block 6036This option will set the @code{basic_block} register in the 6037@code{.debug_line} state machine to @code{true}. 6038 6039@item prologue_end 6040This option will set the @code{prologue_end} register in the 6041@code{.debug_line} state machine to @code{true}. 6042 6043@item epilogue_begin 6044This option will set the @code{epilogue_begin} register in the 6045@code{.debug_line} state machine to @code{true}. 6046 6047@item is_stmt @var{value} 6048This option will set the @code{is_stmt} register in the 6049@code{.debug_line} state machine to @code{value}, which must be 6050either 0 or 1. 6051 6052@item isa @var{value} 6053This directive will set the @code{isa} register in the @code{.debug_line} 6054state machine to @var{value}, which must be an unsigned integer. 6055 6056@item discriminator @var{value} 6057This directive will set the @code{discriminator} register in the @code{.debug_line} 6058state machine to @var{value}, which must be an unsigned integer. 6059 6060@item view @var{value} 6061This option causes a row to be added to @code{.debug_line} in reference to the 6062current address (which might not be the same as that of the following assembly 6063instruction), and to associate @var{value} with the @code{view} register in the 6064@code{.debug_line} state machine. If @var{value} is a label, both the 6065@code{view} register and the label are set to the number of prior @code{.loc} 6066directives at the same program location. If @var{value} is the literal 6067@code{0}, the @code{view} register is set to zero, and the assembler asserts 6068that there aren't any prior @code{.loc} directives at the same program 6069location. If @var{value} is the literal @code{-0}, the assembler arrange for 6070the @code{view} register to be reset in this row, even if there are prior 6071@code{.loc} directives at the same program location. 6072 6073@end table 6074 6075@node Loc_mark_labels 6076@section @code{.loc_mark_labels @var{enable}} 6077@cindex @code{loc_mark_labels} directive 6078When emitting DWARF2 line number information, 6079the @code{.loc_mark_labels} directive makes the assembler emit an entry 6080to the @code{.debug_line} line number matrix with the @code{basic_block} 6081register in the state machine set whenever a code label is seen. 6082The @var{enable} argument should be either 1 or 0, to enable or disable 6083this function respectively. 6084 6085@ifset ELF 6086@node Local 6087@section @code{.local @var{names}} 6088 6089@cindex @code{local} directive 6090This directive, which is available for ELF targets, marks each symbol in 6091the comma-separated list of @code{names} as a local symbol so that it 6092will not be externally visible. If the symbols do not already exist, 6093they will be created. 6094 6095For targets where the @code{.lcomm} directive (@pxref{Lcomm}) does not 6096accept an alignment argument, which is the case for most ELF targets, 6097the @code{.local} directive can be used in combination with @code{.comm} 6098(@pxref{Comm}) to define aligned local common data. 6099@end ifset 6100 6101@node Long 6102@section @code{.long @var{expressions}} 6103 6104@cindex @code{long} directive 6105@code{.long} is the same as @samp{.int}. @xref{Int,,@code{.int}}. 6106 6107@ignore 6108@c no one seems to know what this is for or whether this description is 6109@c what it really ought to do 6110@node Lsym 6111@section @code{.lsym @var{symbol}, @var{expression}} 6112 6113@cindex @code{lsym} directive 6114@cindex symbol, not referenced in assembly 6115@code{.lsym} creates a new symbol named @var{symbol}, but does not put it in 6116the hash table, ensuring it cannot be referenced by name during the 6117rest of the assembly. This sets the attributes of the symbol to be 6118the same as the expression value: 6119@smallexample 6120@var{other} = @var{descriptor} = 0 6121@var{type} = @r{(section of @var{expression})} 6122@var{value} = @var{expression} 6123@end smallexample 6124@noindent 6125The new symbol is not flagged as external. 6126@end ignore 6127 6128@node Macro 6129@section @code{.macro} 6130 6131@cindex macros 6132The commands @code{.macro} and @code{.endm} allow you to define macros that 6133generate assembly output. For example, this definition specifies a macro 6134@code{sum} that puts a sequence of numbers into memory: 6135 6136@example 6137 .macro sum from=0, to=5 6138 .long \from 6139 .if \to-\from 6140 sum "(\from+1)",\to 6141 .endif 6142 .endm 6143@end example 6144 6145@noindent 6146With that definition, @samp{SUM 0,5} is equivalent to this assembly input: 6147 6148@example 6149 .long 0 6150 .long 1 6151 .long 2 6152 .long 3 6153 .long 4 6154 .long 5 6155@end example 6156 6157@ftable @code 6158@item .macro @var{macname} 6159@itemx .macro @var{macname} @var{macargs} @dots{} 6160@cindex @code{macro} directive 6161Begin the definition of a macro called @var{macname}. If your macro 6162definition requires arguments, specify their names after the macro name, 6163separated by commas or spaces. You can qualify the macro argument to 6164indicate whether all invocations must specify a non-blank value (through 6165@samp{:@code{req}}), or whether it takes all of the remaining arguments 6166(through @samp{:@code{vararg}}). You can supply a default value for any 6167macro argument by following the name with @samp{=@var{deflt}}. You 6168cannot define two macros with the same @var{macname} unless it has been 6169subject to the @code{.purgem} directive (@pxref{Purgem}) between the two 6170definitions. For example, these are all valid @code{.macro} statements: 6171 6172@table @code 6173@item .macro comm 6174Begin the definition of a macro called @code{comm}, which takes no 6175arguments. 6176 6177@item .macro plus1 p, p1 6178@itemx .macro plus1 p p1 6179Either statement begins the definition of a macro called @code{plus1}, 6180which takes two arguments; within the macro definition, write 6181@samp{\p} or @samp{\p1} to evaluate the arguments. 6182 6183@item .macro reserve_str p1=0 p2 6184Begin the definition of a macro called @code{reserve_str}, with two 6185arguments. The first argument has a default value, but not the second. 6186After the definition is complete, you can call the macro either as 6187@samp{reserve_str @var{a},@var{b}} (with @samp{\p1} evaluating to 6188@var{a} and @samp{\p2} evaluating to @var{b}), or as @samp{reserve_str 6189,@var{b}} (with @samp{\p1} evaluating as the default, in this case 6190@samp{0}, and @samp{\p2} evaluating to @var{b}). 6191 6192@item .macro m p1:req, p2=0, p3:vararg 6193Begin the definition of a macro called @code{m}, with at least three 6194arguments. The first argument must always have a value specified, but 6195not the second, which instead has a default value. The third formal 6196will get assigned all remaining arguments specified at invocation time. 6197 6198When you call a macro, you can specify the argument values either by 6199position, or by keyword. For example, @samp{sum 9,17} is equivalent to 6200@samp{sum to=17, from=9}. 6201 6202@end table 6203 6204Note that since each of the @var{macargs} can be an identifier exactly 6205as any other one permitted by the target architecture, there may be 6206occasional problems if the target hand-crafts special meanings to certain 6207characters when they occur in a special position. For example, if the colon 6208(@code{:}) is generally permitted to be part of a symbol name, but the 6209architecture specific code special-cases it when occurring as the final 6210character of a symbol (to denote a label), then the macro parameter 6211replacement code will have no way of knowing that and consider the whole 6212construct (including the colon) an identifier, and check only this 6213identifier for being the subject to parameter substitution. So for example 6214this macro definition: 6215 6216@example 6217 .macro label l 6218\l: 6219 .endm 6220@end example 6221 6222might not work as expected. Invoking @samp{label foo} might not create a label 6223called @samp{foo} but instead just insert the text @samp{\l:} into the 6224assembler source, probably generating an error about an unrecognised 6225identifier. 6226 6227Similarly problems might occur with the period character (@samp{.}) 6228which is often allowed inside opcode names (and hence identifier names). So 6229for example constructing a macro to build an opcode from a base name and a 6230length specifier like this: 6231 6232@example 6233 .macro opcode base length 6234 \base.\length 6235 .endm 6236@end example 6237 6238and invoking it as @samp{opcode store l} will not create a @samp{store.l} 6239instruction but instead generate some kind of error as the assembler tries to 6240interpret the text @samp{\base.\length}. 6241 6242There are several possible ways around this problem: 6243 6244@table @code 6245@item Insert white space 6246If it is possible to use white space characters then this is the simplest 6247solution. eg: 6248 6249@example 6250 .macro label l 6251\l : 6252 .endm 6253@end example 6254 6255@item Use @samp{\()} 6256The string @samp{\()} can be used to separate the end of a macro argument from 6257the following text. eg: 6258 6259@example 6260 .macro opcode base length 6261 \base\().\length 6262 .endm 6263@end example 6264 6265@item Use the alternate macro syntax mode 6266In the alternative macro syntax mode the ampersand character (@samp{&}) can be 6267used as a separator. eg: 6268 6269@example 6270 .altmacro 6271 .macro label l 6272l&: 6273 .endm 6274@end example 6275@end table 6276 6277Note: this problem of correctly identifying string parameters to pseudo ops 6278also applies to the identifiers used in @code{.irp} (@pxref{Irp}) 6279and @code{.irpc} (@pxref{Irpc}) as well. 6280 6281Another issue can occur with the actual arguments passed during macro 6282invocation: Multiple arguments can be separated by blanks or commas. To have 6283arguments actually contain blanks or commas (or potentially other non-alpha- 6284numeric characters), individual arguments will need to be enclosed in either 6285parentheses @code{()}, square brackets @code{[]}, or double quote @code{"} 6286characters. The latter may be the only viable option in certain situations, 6287as only double quotes are actually stripped while establishing arguments. It 6288may be important to be aware of two escaping models used when processing such 6289quoted argument strings: For one two adjacent double quotes represent a single 6290double quote in the resulting argument, going along the lines of the stripping 6291of the enclosing quotes. But then double quotes can also be escaped by a 6292backslash @code{\}, but this backslash will not be retained in the resulting 6293actual argument as then seen / used while expanding the macro. 6294 6295As a consequence to the first of these escaping mechanisms two string literals 6296intended to be representing separate macro arguments need to be separated by 6297white space (or, better yet, by a comma). To state it differently, such 6298adjacent string literals - even if separated only by a blank - will not be 6299concatenated when determining macro arguments, even if they're only separated 6300by white space. This is unlike certain other pseudo ops, e.g. @code{.ascii}. 6301 6302@item .endm 6303@cindex @code{endm} directive 6304Mark the end of a macro definition. 6305 6306@item .exitm 6307@cindex @code{exitm} directive 6308Exit early from the current macro definition. 6309 6310@cindex number of macros executed 6311@cindex macros, count executed 6312@item \@@ 6313@command{@value{AS}} maintains a counter of how many macros it has 6314executed in this pseudo-variable; you can copy that number to your 6315output with @samp{\@@}, but @emph{only within a macro definition}. 6316 6317@item LOCAL @var{name} [ , @dots{} ] 6318@emph{Warning: @code{LOCAL} is only available if you select ``alternate 6319macro syntax'' with @samp{--alternate} or @code{.altmacro}.} 6320@xref{Altmacro,,@code{.altmacro}}. 6321@end ftable 6322 6323@node MRI 6324@section @code{.mri @var{val}} 6325 6326@cindex @code{mri} directive 6327@cindex MRI mode, temporarily 6328If @var{val} is non-zero, this tells @command{@value{AS}} to enter MRI mode. If 6329@var{val} is zero, this tells @command{@value{AS}} to exit MRI mode. This change 6330affects code assembled until the next @code{.mri} directive, or until the end 6331of the file. @xref{M, MRI mode, MRI mode}. 6332 6333@node Noaltmacro 6334@section @code{.noaltmacro} 6335Disable alternate macro mode. @xref{Altmacro}. 6336 6337@node Nolist 6338@section @code{.nolist} 6339 6340@cindex @code{nolist} directive 6341@cindex listing control, turning off 6342Control (in conjunction with the @code{.list} directive) whether or 6343not assembly listings are generated. These two directives maintain an 6344internal counter (which is zero initially). @code{.list} increments the 6345counter, and @code{.nolist} decrements it. Assembly listings are 6346generated whenever the counter is greater than zero. 6347 6348@node Nop 6349@section @code{.nop [@var{size}]} 6350 6351@cindex @code{nop} directive 6352@cindex filling memory with no-op instructions 6353This directive emits no-op instructions. It is provided on all architectures, 6354allowing the creation of architecture neutral tests involving actual code. The 6355size of the generated instruction is target specific, but if the optional 6356@var{size} argument is given and resolves to an absolute positive value at that 6357point in assembly (no forward expressions allowed) then the fewest no-op 6358instructions are emitted that equal or exceed a total @var{size} in bytes. 6359@code{.nop} does affect the generation of DWARF debug line information. 6360Some targets do not support using @code{.nop} with @var{size}. 6361 6362@node Nops 6363@section @code{.nops @var{size}[, @var{control}]} 6364 6365@cindex @code{nops} directive 6366@cindex filling memory with no-op instructions 6367This directive emits no-op instructions. It is specific to the Intel 80386 and 6368AMD x86-64 targets. It takes a @var{size} argument and generates @var{size} 6369bytes of no-op instructions. @var{size} must be absolute and positive. These 6370bytes do not affect the generation of DWARF debug line information. 6371 6372The optional @var{control} argument specifies a size limit for a single no-op 6373instruction. If not provided then a value of 0 is assumed. The valid values 6374of @var{control} are between 0 and 4 in 16-bit mode, between 0 and 7 when 6375tuning for older processors in 32-bit mode, between 0 and 11 in 64-bit mode or 6376when tuning for newer processors in 32-bit mode. When 0 is used, the no-op 6377instruction size limit is set to the maximum supported size. 6378 6379@node Octa 6380@section @code{.octa @var{bignums}} 6381 6382@c FIXME: double size emitted for "octa" on some? Or warn? 6383@cindex @code{octa} directive 6384@cindex integer, 16-byte 6385@cindex sixteen byte integer 6386This directive expects zero or more bignums, separated by commas. For each 6387bignum, it emits a 16-byte integer. 6388 6389The term ``octa'' comes from contexts in which a ``word'' is two bytes; 6390hence @emph{octa}-word for 16 bytes. 6391 6392@node Offset 6393@section @code{.offset @var{loc}} 6394 6395@cindex @code{offset} directive 6396Set the location counter to @var{loc} in the absolute section. @var{loc} must 6397be an absolute expression. This directive may be useful for defining 6398symbols with absolute values. Do not confuse it with the @code{.org} 6399directive. 6400 6401@node Org 6402@section @code{.org @var{new-lc} , @var{fill}} 6403 6404@cindex @code{org} directive 6405@cindex location counter, advancing 6406@cindex advancing location counter 6407@cindex current address, advancing 6408Advance the location counter of the current section to 6409@var{new-lc}. @var{new-lc} is either an absolute expression or an 6410expression with the same section as the current subsection. That is, 6411you can't use @code{.org} to cross sections: if @var{new-lc} has the 6412wrong section, the @code{.org} directive is ignored. To be compatible 6413with former assemblers, if the section of @var{new-lc} is absolute, 6414@command{@value{AS}} issues a warning, then pretends the section of @var{new-lc} 6415is the same as the current subsection. 6416 6417@code{.org} may only increase the location counter, or leave it 6418unchanged; you cannot use @code{.org} to move the location counter 6419backwards. 6420 6421@c double negative used below "not undefined" because this is a specific 6422@c reference to "undefined" (as SEG_UNKNOWN is called in this manual) 6423@c section. doc@cygnus.com 18feb91 6424Because @command{@value{AS}} tries to assemble programs in one pass, @var{new-lc} 6425may not be undefined. If you really detest this restriction we eagerly await 6426a chance to share your improved assembler. 6427 6428Beware that the origin is relative to the start of the section, not 6429to the start of the subsection. This is compatible with other 6430people's assemblers. 6431 6432When the location counter (of the current subsection) is advanced, the 6433intervening bytes are filled with @var{fill} which should be an 6434absolute expression. If the comma and @var{fill} are omitted, 6435@var{fill} defaults to zero. 6436 6437@node P2align 6438@section @code{.p2align[wl] [@var{abs-expr}[, @var{abs-expr}[, @var{abs-expr}]]]} 6439 6440@cindex padding the location counter given a power of two 6441@cindex @code{p2align} directive 6442Pad the location counter (in the current subsection) to a particular 6443storage boundary. The first expression (which must be absolute) is the 6444number of low-order zero bits the location counter must have after 6445advancement. For example @samp{.p2align 3} advances the location 6446counter until it is a multiple of 8. If the location counter is already a 6447multiple of 8, no change is needed. If the expression is omitted then a 6448default value of 0 is used, effectively disabling alignment requirements. 6449 6450The second expression (also absolute) gives the fill value to be stored in the 6451padding bytes. It (and the comma) may be omitted. If it is omitted, the 6452padding bytes are normally zero. However, on most systems, if the section is 6453marked as containing code and the fill value is omitted, the space is filled 6454with no-op instructions. 6455 6456The third expression is also absolute, and is also optional. If it is present, 6457it is the maximum number of bytes that should be skipped by this alignment 6458directive. If doing the alignment would require skipping more bytes than the 6459specified maximum, then the alignment is not done at all. You can omit the 6460fill value (the second argument) entirely by simply using two commas after the 6461required alignment; this can be useful if you want the alignment to be filled 6462with no-op instructions when appropriate. 6463 6464@cindex @code{p2alignw} directive 6465@cindex @code{p2alignl} directive 6466The @code{.p2alignw} and @code{.p2alignl} directives are variants of the 6467@code{.p2align} directive. The @code{.p2alignw} directive treats the fill 6468pattern as a two byte word value. The @code{.p2alignl} directives treats the 6469fill pattern as a four byte longword value. For example, @code{.p2alignw 64702,0x368d} will align to a multiple of 4. If it skips two bytes, they will be 6471filled in with the value 0x368d (the exact placement of the bytes depends upon 6472the endianness of the processor). If it skips 1 or 3 bytes, the fill value is 6473undefined. 6474 6475@ifset ELF 6476@node PopSection 6477@section @code{.popsection} 6478 6479@cindex @code{popsection} directive 6480@cindex Section Stack 6481This is one of the ELF section stack manipulation directives. The others are 6482@code{.section} (@pxref{Section}), @code{.subsection} (@pxref{SubSection}), 6483@code{.pushsection} (@pxref{PushSection}), and @code{.previous} 6484(@pxref{Previous}). 6485 6486This directive replaces the current section (and subsection) with the top 6487section (and subsection) on the section stack. This section is popped off the 6488stack. 6489@end ifset 6490 6491@ifset ELF 6492@node Previous 6493@section @code{.previous} 6494 6495@cindex @code{previous} directive 6496@cindex Section Stack 6497This is one of the ELF section stack manipulation directives. The others are 6498@code{.section} (@pxref{Section}), @code{.subsection} (@pxref{SubSection}), 6499@code{.pushsection} (@pxref{PushSection}), and @code{.popsection} 6500(@pxref{PopSection}). 6501 6502This directive swaps the current section (and subsection) with most recently 6503referenced section/subsection pair prior to this one. Multiple 6504@code{.previous} directives in a row will flip between two sections (and their 6505subsections). For example: 6506 6507@smallexample 6508.section A 6509 .subsection 1 6510 .word 0x1234 6511 .subsection 2 6512 .word 0x5678 6513.previous 6514 .word 0x9abc 6515@end smallexample 6516 6517Will place 0x1234 and 0x9abc into subsection 1 and 0x5678 into subsection 2 of 6518section A. Whilst: 6519 6520@smallexample 6521.section A 6522.subsection 1 6523 # Now in section A subsection 1 6524 .word 0x1234 6525.section B 6526.subsection 0 6527 # Now in section B subsection 0 6528 .word 0x5678 6529.subsection 1 6530 # Now in section B subsection 1 6531 .word 0x9abc 6532.previous 6533 # Now in section B subsection 0 6534 .word 0xdef0 6535@end smallexample 6536 6537Will place 0x1234 into section A, 0x5678 and 0xdef0 into subsection 0 of 6538section B and 0x9abc into subsection 1 of section B. 6539 6540In terms of the section stack, this directive swaps the current section with 6541the top section on the section stack. 6542@end ifset 6543 6544@node Print 6545@section @code{.print @var{string}} 6546 6547@cindex @code{print} directive 6548@command{@value{AS}} will print @var{string} on the standard output during 6549assembly. You must put @var{string} in double quotes. 6550 6551@ifset ELF 6552@node Protected 6553@section @code{.protected @var{names}} 6554 6555@cindex @code{protected} directive 6556@cindex visibility 6557This is one of the ELF visibility directives. The other two are 6558@code{.hidden} (@pxref{Hidden}) and @code{.internal} (@pxref{Internal}). 6559 6560This directive overrides the named symbols default visibility (which is set by 6561their binding: local, global or weak). The directive sets the visibility to 6562@code{protected} which means that any references to the symbols from within the 6563components that defines them must be resolved to the definition in that 6564component, even if a definition in another component would normally preempt 6565this. 6566@end ifset 6567 6568@node Psize 6569@section @code{.psize @var{lines} , @var{columns}} 6570 6571@cindex @code{psize} directive 6572@cindex listing control: paper size 6573@cindex paper size, for listings 6574Use this directive to declare the number of lines---and, optionally, the 6575number of columns---to use for each page, when generating listings. 6576 6577If you do not use @code{.psize}, listings use a default line-count 6578of 60. You may omit the comma and @var{columns} specification; the 6579default width is 200 columns. 6580 6581@command{@value{AS}} generates formfeeds whenever the specified number of 6582lines is exceeded (or whenever you explicitly request one, using 6583@code{.eject}). 6584 6585If you specify @var{lines} as @code{0}, no formfeeds are generated save 6586those explicitly specified with @code{.eject}. 6587 6588@node Purgem 6589@section @code{.purgem @var{name}} 6590 6591@cindex @code{purgem} directive 6592Undefine the macro @var{name}, so that later uses of the string will not be 6593expanded. @xref{Macro}. 6594 6595@ifset ELF 6596@node PushSection 6597@section @code{.pushsection @var{name} [, @var{subsection}] [, "@var{flags}"[, @@@var{type}[,@var{arguments}]]]} 6598 6599@cindex @code{pushsection} directive 6600@cindex Section Stack 6601This is one of the ELF section stack manipulation directives. The others are 6602@code{.section} (@pxref{Section}), @code{.subsection} (@pxref{SubSection}), 6603@code{.popsection} (@pxref{PopSection}), and @code{.previous} 6604(@pxref{Previous}). 6605 6606This directive pushes the current section (and subsection) onto the 6607top of the section stack, and then replaces the current section and 6608subsection with @code{name} and @code{subsection}. The optional 6609@code{flags}, @code{type} and @code{arguments} are treated the same 6610as in the @code{.section} (@pxref{Section}) directive. 6611@end ifset 6612 6613@node Quad 6614@section @code{.quad @var{expressions}} 6615 6616@cindex @code{quad} directive 6617@ifclear bignum-16 6618For 64-bit architectures, or more generally with any GAS configured to support 661964-bit target virtual addresses, this is like @samp{.int}, but emitting 64-bit 6620quantities. Otherwise @code{.quad} expects zero or more bignums, separated by 6621commas. For each item, it emits an 8-byte integer. If a bignum won't fit in 66228 bytes, a warning message is printed and just the lowest order 8 bytes of the 6623bignum are taken. 6624@cindex eight-byte integer 6625@cindex integer, 8-byte 6626 6627The term ``quad'' comes from contexts in which a ``word'' is two bytes; 6628hence @emph{quad}-word for 8 bytes. 6629@end ifclear 6630@ifset bignum-16 6631@code{.quad} expects zero or more bignums, separated by commas. For 6632each bignum, it emits a 16-byte integer. If the bignum won't fit in 16 6633bytes, it prints a warning message; and just takes the lowest order 16 6634bytes of the bignum. 6635@xref{Octa,,@code{.octa @var{bignums}}}. 6636@cindex sixteen-byte integer 6637@cindex integer, 16-byte 6638@end ifset 6639 6640Note - this directive is not intended for encoding instructions, and it will 6641not trigger effects like DWARF line number generation. Instead some targets 6642support special directives for encoding arbitrary binary sequences as 6643instructions such as @code{.insn} or @code{.inst}. 6644 6645@node Reloc 6646@section @code{.reloc @var{offset}, @var{reloc_name}[, @var{expression}]} 6647 6648@cindex @code{reloc} directive 6649Generate a relocation at @var{offset} of type @var{reloc_name} with value 6650@var{expression}. If @var{offset} is a number, the relocation is generated in 6651the current section. If @var{offset} is an expression that resolves to a 6652symbol plus offset, the relocation is generated in the given symbol's section. 6653@var{expression}, if present, must resolve to a symbol plus addend or to an 6654absolute value, but note that not all targets support an addend. e.g. ELF REL 6655targets such as i386 store an addend in the section contents rather than in the 6656relocation. This low level interface does not support addends stored in the 6657section. 6658 6659@node Rept 6660@section @code{.rept @var{count}} 6661 6662@cindex @code{rept} directive 6663Repeat the sequence of lines between the @code{.rept} directive and the next 6664@code{.endr} directive @var{count} times. 6665 6666For example, assembling 6667 6668@example 6669 .rept 3 6670 .long 0 6671 .endr 6672@end example 6673 6674is equivalent to assembling 6675 6676@example 6677 .long 0 6678 .long 0 6679 .long 0 6680@end example 6681 6682A count of zero is allowed, but nothing is generated. Negative counts are not 6683allowed and if encountered will be treated as if they were zero. 6684 6685@node Sbttl 6686@section @code{.sbttl "@var{subheading}"} 6687 6688@cindex @code{sbttl} directive 6689@cindex subtitles for listings 6690@cindex listing control: subtitle 6691Use @var{subheading} as the title (third line, immediately after the 6692title line) when generating assembly listings. 6693 6694This directive affects subsequent pages, as well as the current page if 6695it appears within ten lines of the top of a page. 6696 6697@ifset COFF 6698@node Scl 6699@section @code{.scl @var{class}} 6700 6701@cindex @code{scl} directive 6702@cindex symbol storage class (COFF) 6703@cindex COFF symbol storage class 6704Set the storage-class value for a symbol. This directive may only be 6705used inside a @code{.def}/@code{.endef} pair. Storage class may flag 6706whether a symbol is static or external, or it may record further 6707symbolic debugging information. 6708@end ifset 6709 6710@ifset COFF-ELF 6711@node Section 6712@section @code{.section @var{name}} 6713 6714@cindex named section 6715Use the @code{.section} directive to assemble the following code into a section 6716named @var{name}. 6717 6718This directive is only supported for targets that actually support arbitrarily 6719named sections; on @code{a.out} targets, for example, it is not accepted, even 6720with a standard @code{a.out} section name. 6721 6722@ifset COFF 6723@ifset ELF 6724@c only print the extra heading if both COFF and ELF are set 6725@subheading COFF Version 6726@end ifset 6727 6728@cindex @code{section} directive (COFF version) 6729For COFF targets, the @code{.section} directive is used in one of the following 6730ways: 6731 6732@smallexample 6733.section @var{name}[, "@var{flags}"] 6734.section @var{name}[, @var{subsection}] 6735@end smallexample 6736 6737If the optional argument is quoted, it is taken as flags to use for the 6738section. Each flag is a single character. The following flags are recognized: 6739 6740@table @code 6741@item b 6742bss section (uninitialized data) 6743@item n 6744section is not loaded 6745@item w 6746writable section 6747@item d 6748data section 6749@item e 6750exclude section from linking 6751@item r 6752read-only section 6753@item x 6754executable section 6755@item s 6756shared section (meaningful for PE targets) 6757@item a 6758ignored. (For compatibility with the ELF version) 6759@item y 6760section is not readable (meaningful for PE targets) 6761@item 0-9 6762single-digit power-of-two section alignment (GNU extension) 6763@end table 6764 6765If no flags are specified, the default flags depend upon the section name. If 6766the section name is not recognized, the default will be for the section to be 6767loaded and writable. Note the @code{n} and @code{w} flags remove attributes 6768from the section, rather than adding them, so if they are used on their own it 6769will be as if no flags had been specified at all. 6770 6771If the optional argument to the @code{.section} directive is not quoted, it is 6772taken as a subsection number (@pxref{Sub-Sections}). 6773@end ifset 6774 6775@ifset ELF 6776@ifset COFF 6777@c only print the extra heading if both COFF and ELF are set 6778@subheading ELF Version 6779@end ifset 6780 6781@cindex Section Stack 6782This is one of the ELF section stack manipulation directives. The others are 6783@code{.subsection} (@pxref{SubSection}), @code{.pushsection} 6784(@pxref{PushSection}), @code{.popsection} (@pxref{PopSection}), and 6785@code{.previous} (@pxref{Previous}). 6786 6787@cindex @code{section} directive (ELF version) 6788For ELF targets, the @code{.section} directive is used like this: 6789 6790@smallexample 6791.section @var{name} [, "@var{flags}"[, @@@var{type}[,@var{flag_specific_arguments}]]] 6792@end smallexample 6793 6794@anchor{Section Name Substitutions} 6795@kindex --sectname-subst 6796@cindex section name substitution 6797If the @samp{--sectname-subst} command-line option is provided, the @var{name} 6798argument may contain a substitution sequence. Only @code{%S} is supported 6799at the moment, and substitutes the current section name. For example: 6800 6801@smallexample 6802.macro exception_code 6803.section %S.exception 6804[exception code here] 6805.previous 6806.endm 6807 6808.text 6809[code] 6810exception_code 6811[...] 6812 6813.section .init 6814[init code] 6815exception_code 6816[...] 6817@end smallexample 6818 6819The two @code{exception_code} invocations above would create the 6820@code{.text.exception} and @code{.init.exception} sections respectively. 6821This is useful e.g. to discriminate between ancillary sections that are 6822tied to setup code to be discarded after use from ancillary sections that 6823need to stay resident without having to define multiple @code{exception_code} 6824macros just for that purpose. 6825 6826The optional @var{flags} argument is a quoted string which may contain any 6827combination of the following characters: 6828 6829@table @code 6830@item a 6831section is allocatable 6832@item d 6833section is a GNU_MBIND section 6834@item e 6835section is excluded from executable and shared library. 6836@item o 6837section references a symbol defined in another section (the linked-to 6838section) in the same file. 6839@item w 6840section is writable 6841@item x 6842section is executable 6843@item M 6844section is mergeable 6845@item S 6846section contains zero terminated strings 6847@item G 6848section is a member of a section group 6849@item T 6850section is used for thread-local-storage 6851@item ? 6852section is a member of the previously-current section's group, if any 6853@item + 6854section inherits attributes and (unless explicitly specified) type from the 6855previously-current section, adding other attributes as specified 6856@item - 6857section inherits attributes and (unless explicitly specified) type from the 6858previously-current section, removing other attributes as specified 6859@item R 6860retained section (apply SHF_GNU_RETAIN to prevent linker garbage 6861collection, GNU ELF extension) 6862@item @code{<number>} 6863a numeric value indicating the bits to be set in the ELF section header's flags 6864field. Note - if one or more of the alphabetic characters described above is 6865also included in the flags field, their bit values will be ORed into the 6866resulting value. 6867@item @code{<target specific>} 6868some targets extend this list with their own flag characters 6869@end table 6870 6871Note - once a section's flags have been set they cannot be changed. There are 6872a few exceptions to this rule however. Processor and application specific 6873flags can be added to an already defined section. The @code{.interp}, 6874@code{.strtab} and @code{.symtab} sections can have the allocate flag 6875(@code{a}) set after they are initially defined, and the @code{.note-GNU-stack} 6876section may have the executable (@code{x}) flag added. Also note that the 6877@code{.attach_to_group} directive can be used to add a section to a group even 6878if the section was not originally declared to be part of that group. 6879 6880Note further that @code{+} and @code{-} need to come first and can only take 6881the effect described here unless overridden by a target. The attributes 6882inherited are those in effect at the time the directive is processed. 6883Attributes added later (see above) will not be inherited. Using either 6884together with @code{?} is undefined at this point. 6885 6886The optional @var{type} argument may contain one of the following constants: 6887 6888@table @code 6889@item @@progbits 6890section contains data 6891@item @@nobits 6892section does not contain data (i.e., section only occupies space) 6893@item @@note 6894section contains data which is used by things other than the program 6895@item @@init_array 6896section contains an array of pointers to init functions 6897@item @@fini_array 6898section contains an array of pointers to finish functions 6899@item @@preinit_array 6900section contains an array of pointers to pre-init functions 6901@item @@@code{<number>} 6902a numeric value to be set as the ELF section header's type field. 6903@item @@@code{<target specific>} 6904some targets extend this list with their own types 6905@end table 6906 6907Many targets only support the first three section types. The type may be 6908enclosed in double quotes if necessary. 6909 6910Note on targets where the @code{@@} character is the start of a comment (eg 6911ARM) then another character is used instead. For example the ARM port uses the 6912@code{%} character. 6913 6914Note - some sections, eg @code{.text} and @code{.data} are considered to be 6915special and have fixed types. Any attempt to declare them with a different 6916type will generate an error from the assembler. 6917 6918If @var{flags} contains the @code{M} symbol then the @var{type} argument must 6919be specified as well as an extra argument---@var{entsize}---like this: 6920 6921@smallexample 6922.section @var{name} , "@var{flags}"M, @@@var{type}, @var{entsize} 6923@end smallexample 6924 6925Sections with the @code{M} flag but not @code{S} flag must contain fixed size 6926constants, each @var{entsize} octets long. Sections with both @code{M} and 6927@code{S} must contain zero terminated strings where each character is 6928@var{entsize} bytes long. The linker may remove duplicates within sections with 6929the same name, same entity size and same flags. @var{entsize} must be an 6930absolute expression. For sections with both @code{M} and @code{S}, a string 6931which is a suffix of a larger string is considered a duplicate. Thus 6932@code{"def"} will be merged with @code{"abcdef"}; A reference to the first 6933@code{"def"} will be changed to a reference to @code{"abcdef"+3}. 6934 6935If @var{flags} contains the @code{o} flag, then the @var{type} argument 6936must be present along with an additional field like this: 6937 6938@smallexample 6939.section @var{name},"@var{flags}"o,@@@var{type},@var{SymbolName}|@var{SectionIndex} 6940@end smallexample 6941 6942The @var{SymbolName} field specifies the symbol name which the section 6943references. Alternatively a numeric @var{SectionIndex} can be provided. This 6944is not generally a good idea as section indices are rarely known at assembly 6945time, but the facility is provided for testing purposes. An index of zero is 6946allowed. It indicates that the linked-to section has already been discarded. 6947 6948Note: If both the @var{M} and @var{o} flags are present, then the fields 6949for the Merge flag should come first, like this: 6950 6951@smallexample 6952.section @var{name},"@var{flags}"Mo,@@@var{type},@var{entsize},@var{SymbolName} 6953@end smallexample 6954 6955If @var{flags} contains the @code{G} symbol then the @var{type} argument must 6956be present along with an additional field like this: 6957 6958@smallexample 6959.section @var{name} , "@var{flags}"G, @@@var{type}, @var{GroupName}[, @var{linkage}] 6960@end smallexample 6961 6962The @var{GroupName} field specifies the name of the section group to which this 6963particular section belongs. The optional linkage field can contain: 6964 6965@table @code 6966@item comdat 6967indicates that only one copy of this section should be retained 6968@item .gnu.linkonce 6969an alias for comdat 6970@end table 6971 6972Note: if both the @var{M} and @var{G} flags are present then the fields for 6973the Merge flag should come first, like this: 6974 6975@smallexample 6976.section @var{name} , "@var{flags}"MG, @@@var{type}, @var{entsize}, @var{GroupName}[, @var{linkage}] 6977@end smallexample 6978 6979If both @code{o} flag and @code{G} flag are present, then the 6980@var{SymbolName} field for @code{o} comes first, like this: 6981 6982@smallexample 6983.section @var{name},"@var{flags}"oG,@@@var{type},@var{SymbolName},@var{GroupName}[,@var{linkage}] 6984@end smallexample 6985 6986If @var{flags} contains the @code{?} symbol then it may not also contain the 6987@code{G} symbol and the @var{GroupName} or @var{linkage} fields should not be 6988present. Instead, @code{?} says to consider the section that's current before 6989this directive. If that section used @code{G}, then the new section will use 6990@code{G} with those same @var{GroupName} and @var{linkage} fields implicitly. 6991If not, then the @code{?} symbol has no effect. 6992 6993The optional @var{unique,@code{<number>}} argument must come last. It 6994assigns @var{@code{<number>}} as a unique section ID to distinguish 6995different sections with the same section name like these: 6996 6997@smallexample 6998.section @var{name},"@var{flags}",@@@var{type},@var{unique,@code{<number>}} 6999.section @var{name},"@var{flags}"G,@@@var{type},@var{GroupName},[@var{linkage}],@var{unique,@code{<number>}} 7000.section @var{name},"@var{flags}"MG,@@@var{type},@var{entsize},@var{GroupName}[,@var{linkage}],@var{unique,@code{<number>}} 7001@end smallexample 7002 7003The valid values of @var{@code{<number>}} are between 0 and 4294967295. 7004 7005If no flags are specified, the default flags depend upon the section name. If 7006the section name is not recognized, the default will be for the section to have 7007none of the above flags: it will not be allocated in memory, nor writable, nor 7008executable. The section will contain data. 7009 7010For SPARC ELF targets, the assembler supports another type of @code{.section} 7011directive for compatibility with the Solaris assembler: 7012 7013@smallexample 7014.section "@var{name}"[, @var{flags}...] 7015@end smallexample 7016 7017Note that the section name is quoted. There may be a sequence of comma 7018separated flags: 7019 7020@table @code 7021@item #alloc 7022section is allocatable 7023@item #write 7024section is writable 7025@item #execinstr 7026section is executable 7027@item #exclude 7028section is excluded from executable and shared library. 7029@item #tls 7030section is used for thread local storage 7031@end table 7032 7033This directive replaces the current section and subsection. See the 7034contents of the gas testsuite directory @code{gas/testsuite/gas/elf} for 7035some examples of how this directive and the other section stack directives 7036work. 7037@end ifset 7038@end ifset 7039 7040@node Set 7041@section @code{.set @var{symbol}, @var{expression}} 7042 7043@cindex @code{set} directive 7044@cindex symbol value, setting 7045Set the value of @var{symbol} to @var{expression}. This 7046changes @var{symbol}'s value and type to conform to 7047@var{expression}. If @var{symbol} was flagged as external, it remains 7048flagged (@pxref{Symbol Attributes}). 7049 7050You may @code{.set} a symbol many times in the same assembly provided that the 7051values given to the symbol are constants. Values that are based on expressions 7052involving other symbols are allowed, but some targets may restrict this to only 7053being done once per assembly. This is because those targets do not set the 7054addresses of symbols at assembly time, but rather delay the assignment until a 7055final link is performed. This allows the linker a chance to change the code in 7056the files, changing the location of, and the relative distance between, various 7057different symbols. 7058 7059If you @code{.set} a global symbol, the value stored in the object 7060file is the last value stored into it. 7061 7062@ifset Z80 7063On Z80 @code{set} is a real instruction, use @code{.set} or 7064@samp{@var{symbol} defl @var{expression}} instead. 7065@end ifset 7066 7067@node Short 7068@section @code{.short @var{expressions}} 7069 7070@cindex @code{short} directive 7071@ifset GENERIC 7072@code{.short} is normally the same as @samp{.word}. 7073@xref{Word,,@code{.word}}. 7074 7075In some configurations, however, @code{.short} and @code{.word} generate 7076numbers of different lengths. @xref{Machine Dependencies}. 7077@end ifset 7078@ifclear GENERIC 7079@ifset W16 7080@code{.short} is the same as @samp{.word}. @xref{Word,,@code{.word}}. 7081@end ifset 7082@ifset W32 7083This expects zero or more @var{expressions}, and emits 7084a 16 bit number for each. 7085@end ifset 7086@end ifclear 7087 7088Note - this directive is not intended for encoding instructions, and it will 7089not trigger effects like DWARF line number generation. Instead some targets 7090support special directives for encoding arbitrary binary sequences as 7091instructions such as @code{.insn} or @code{.inst}. 7092 7093@node Single 7094@section @code{.single @var{flonums}} 7095 7096@cindex @code{single} directive 7097@cindex floating point numbers (single) 7098This directive assembles zero or more flonums, separated by commas. It 7099has the same effect as @code{.float}. 7100@ifset GENERIC 7101The exact kind of floating point numbers emitted depends on how 7102@command{@value{AS}} is configured. @xref{Machine Dependencies}. 7103@end ifset 7104@ifclear GENERIC 7105@ifset IEEEFLOAT 7106On the @value{TARGET} family, @code{.single} emits 32-bit floating point 7107numbers in @sc{ieee} format. 7108@end ifset 7109@end ifclear 7110 7111@ifset COFF-ELF 7112@node Size 7113@section @code{.size} 7114 7115This directive is used to set the size associated with a symbol. 7116 7117@ifset COFF 7118@ifset ELF 7119@c only print the extra heading if both COFF and ELF are set 7120@subheading COFF Version 7121@end ifset 7122 7123@cindex @code{size} directive (COFF version) 7124For COFF targets, the @code{.size} directive is only permitted inside 7125@code{.def}/@code{.endef} pairs. It is used like this: 7126 7127@smallexample 7128.size @var{expression} 7129@end smallexample 7130 7131@end ifset 7132 7133@ifset ELF 7134@ifset COFF 7135@c only print the extra heading if both COFF and ELF are set 7136@subheading ELF Version 7137@end ifset 7138 7139@cindex @code{size} directive (ELF version) 7140For ELF targets, the @code{.size} directive is used like this: 7141 7142@smallexample 7143.size @var{name} , @var{expression} 7144@end smallexample 7145 7146This directive sets the size associated with a symbol @var{name}. 7147The size in bytes is computed from @var{expression} which can make use of label 7148arithmetic. This directive is typically used to set the size of function 7149symbols. 7150@end ifset 7151@end ifset 7152 7153@ifclear no-space-dir 7154@node Skip 7155@section @code{.skip @var{size} [,@var{fill}]} 7156 7157@cindex @code{skip} directive 7158@cindex filling memory 7159This directive emits @var{size} bytes, each of value @var{fill}. Both 7160@var{size} and @var{fill} are absolute expressions. If the comma and 7161@var{fill} are omitted, @var{fill} is assumed to be zero. This is the same as 7162@samp{.space}. 7163@end ifclear 7164 7165@node Sleb128 7166@section @code{.sleb128 @var{expressions}} 7167 7168@cindex @code{sleb128} directive 7169@var{sleb128} stands for ``signed little endian base 128.'' This is a 7170compact, variable length representation of numbers used by the DWARF 7171symbolic debugging format. @xref{Uleb128, ,@code{.uleb128}}. 7172 7173@ifclear no-space-dir 7174@node Space 7175@section @code{.space @var{size} [,@var{fill}]} 7176 7177@cindex @code{space} directive 7178@cindex filling memory 7179This directive emits @var{size} bytes, each of value @var{fill}. Both 7180@var{size} and @var{fill} are absolute expressions. If the comma 7181and @var{fill} are omitted, @var{fill} is assumed to be zero. This is the same 7182as @samp{.skip}. 7183 7184@ifset HPPA 7185@quotation 7186@emph{Warning:} @code{.space} has a completely different meaning for HPPA 7187targets; use @code{.block} as a substitute. See @cite{HP9000 Series 800 7188Assembly Language Reference Manual} (HP 92432-90001) for the meaning of the 7189@code{.space} directive. @xref{HPPA Directives,,HPPA Assembler Directives}, 7190for a summary. 7191@end quotation 7192@end ifset 7193@end ifclear 7194 7195@ifset have-stabs 7196@node Stab 7197@section @code{.stabd, .stabn, .stabs} 7198 7199@cindex symbolic debuggers, information for 7200@cindex @code{stab@var{x}} directives 7201There are three directives that begin @samp{.stab}. 7202All emit symbols (@pxref{Symbols}), for use by symbolic debuggers. 7203The symbols are not entered in the @command{@value{AS}} hash table: they 7204cannot be referenced elsewhere in the source file. 7205Up to five fields are required: 7206 7207@table @var 7208@item string 7209This is the symbol's name. It may contain any character except 7210@samp{\000}, so is more general than ordinary symbol names. Some 7211debuggers used to code arbitrarily complex structures into symbol names 7212using this field. 7213 7214@item type 7215An absolute expression. The symbol's type is set to the low 8 bits of 7216this expression. Any bit pattern is permitted, but @code{@value{LD}} 7217and debuggers choke on silly bit patterns. 7218 7219@item other 7220An absolute expression. The symbol's ``other'' attribute is set to the 7221low 8 bits of this expression. 7222 7223@item desc 7224An absolute expression. The symbol's descriptor is set to the low 16 7225bits of this expression. 7226 7227@item value 7228An absolute expression which becomes the symbol's value. 7229@end table 7230 7231If a warning is detected while reading a @code{.stabd}, @code{.stabn}, 7232or @code{.stabs} statement, the symbol has probably already been created; 7233you get a half-formed symbol in your object file. This is 7234compatible with earlier assemblers! 7235 7236@table @code 7237@cindex @code{stabd} directive 7238@item .stabd @var{type} , @var{other} , @var{desc} 7239 7240The ``name'' of the symbol generated is not even an empty string. 7241It is a null pointer, for compatibility. Older assemblers used a 7242null pointer so they didn't waste space in object files with empty 7243strings. 7244 7245The symbol's value is set to the location counter, 7246relocatably. When your program is linked, the value of this symbol 7247is the address of the location counter when the @code{.stabd} was 7248assembled. 7249 7250@cindex @code{stabn} directive 7251@item .stabn @var{type} , @var{other} , @var{desc} , @var{value} 7252The name of the symbol is set to the empty string @code{""}. 7253 7254@cindex @code{stabs} directive 7255@item .stabs @var{string} , @var{type} , @var{other} , @var{desc} , @var{value} 7256All five fields are specified. 7257@end table 7258@end ifset 7259@c end have-stabs 7260 7261@node String 7262@section @code{.string} "@var{str}", @code{.string8} "@var{str}", @code{.string16} 7263"@var{str}", @code{.string32} "@var{str}", @code{.string64} "@var{str}" 7264 7265@cindex string, copying to object file 7266@cindex string8, copying to object file 7267@cindex string16, copying to object file 7268@cindex string32, copying to object file 7269@cindex string64, copying to object file 7270@cindex @code{string} directive 7271@cindex @code{string8} directive 7272@cindex @code{string16} directive 7273@cindex @code{string32} directive 7274@cindex @code{string64} directive 7275 7276Copy the characters in @var{str} to the object file. You may specify more than 7277one string to copy, separated by commas. Unless otherwise specified for a 7278particular machine, the assembler marks the end of each string with a 0 byte. 7279You can use any of the escape sequences described in @ref{Strings,,Strings}. 7280 7281The variants @code{string16}, @code{string32} and @code{string64} differ from 7282the @code{string} pseudo opcode in that each 8-bit character from @var{str} is 7283copied and expanded to 16, 32 or 64 bits respectively. The expanded characters 7284are stored in target endianness byte order. 7285 7286Example: 7287@smallexample 7288 .string32 "BYE" 7289expands to: 7290 .string "B\0\0\0Y\0\0\0E\0\0\0" /* On little endian targets. */ 7291 .string "\0\0\0B\0\0\0Y\0\0\0E" /* On big endian targets. */ 7292@end smallexample 7293 7294 7295@node Struct 7296@section @code{.struct @var{expression}} 7297 7298@cindex @code{struct} directive 7299Switch to the absolute section, and set the section offset to @var{expression}, 7300which must be an absolute expression. You might use this as follows: 7301@smallexample 7302 .struct 0 7303field1: 7304 .struct field1 + 4 7305field2: 7306 .struct field2 + 4 7307field3: 7308@end smallexample 7309This would define the symbol @code{field1} to have the value 0, the symbol 7310@code{field2} to have the value 4, and the symbol @code{field3} to have the 7311value 8. Assembly would be left in the absolute section, and you would need to 7312use a @code{.section} directive of some sort to change to some other section 7313before further assembly. 7314 7315@ifset ELF 7316@node SubSection 7317@section @code{.subsection @var{name}} 7318 7319@cindex @code{subsection} directive 7320@cindex Section Stack 7321This is one of the ELF section stack manipulation directives. The others are 7322@code{.section} (@pxref{Section}), @code{.pushsection} (@pxref{PushSection}), 7323@code{.popsection} (@pxref{PopSection}), and @code{.previous} 7324(@pxref{Previous}). 7325 7326This directive replaces the current subsection with @code{name}. The current 7327section is not changed. The replaced subsection is put onto the section stack 7328in place of the then current top of stack subsection. 7329@end ifset 7330 7331@ifset ELF 7332@node Symver 7333@section @code{.symver} 7334@cindex @code{symver} directive 7335@cindex symbol versioning 7336@cindex versions of symbols 7337Use the @code{.symver} directive to bind symbols to specific version nodes 7338within a source file. This is only supported on ELF platforms, and is 7339typically used when assembling files to be linked into a shared library. 7340There are cases where it may make sense to use this in objects to be bound 7341into an application itself so as to override a versioned symbol from a 7342shared library. 7343 7344For ELF targets, the @code{.symver} directive can be used like this: 7345@smallexample 7346.symver @var{name}, @var{name2@@nodename}[ ,@var{visibility}] 7347@end smallexample 7348If the original symbol @var{name} is defined within the file 7349being assembled, the @code{.symver} directive effectively creates a symbol 7350alias with the name @var{name2@@nodename}, and in fact the main reason that we 7351just don't try and create a regular alias is that the @var{@@} character isn't 7352permitted in symbol names. The @var{name2} part of the name is the actual name 7353of the symbol by which it will be externally referenced. The name @var{name} 7354itself is merely a name of convenience that is used so that it is possible to 7355have definitions for multiple versions of a function within a single source 7356file, and so that the compiler can unambiguously know which version of a 7357function is being mentioned. The @var{nodename} portion of the alias should be 7358the name of a node specified in the version script supplied to the linker when 7359building a shared library. If you are attempting to override a versioned 7360symbol from a shared library, then @var{nodename} should correspond to the 7361nodename of the symbol you are trying to override. The optional argument 7362@var{visibility} updates the visibility of the original symbol. The valid 7363visibilities are @code{local}, @code{hidden}, and @code{remove}. The 7364@code{local} visibility makes the original symbol a local symbol 7365(@pxref{Local}). The @code{hidden} visibility sets the visibility of the 7366original symbol to @code{hidden} (@pxref{Hidden}). The @code{remove} 7367visibility removes the original symbol from the symbol table. If visibility 7368isn't specified, the original symbol is unchanged. 7369 7370If the symbol @var{name} is not defined within the file being assembled, all 7371references to @var{name} will be changed to @var{name2@@nodename}. If no 7372reference to @var{name} is made, @var{name2@@nodename} will be removed from the 7373symbol table. 7374 7375Another usage of the @code{.symver} directive is: 7376@smallexample 7377.symver @var{name}, @var{name2@@@@nodename} 7378@end smallexample 7379In this case, the symbol @var{name} must exist and be defined within 7380the file being assembled. It is similar to @var{name2@@nodename}. The 7381difference is @var{name2@@@@nodename} will also be used to resolve 7382references to @var{name2} by the linker. 7383 7384The third usage of the @code{.symver} directive is: 7385@smallexample 7386.symver @var{name}, @var{name2@@@@@@nodename} 7387@end smallexample 7388When @var{name} is not defined within the 7389file being assembled, it is treated as @var{name2@@nodename}. When 7390@var{name} is defined within the file being assembled, the symbol 7391name, @var{name}, will be changed to @var{name2@@@@nodename}. 7392@end ifset 7393 7394@ifset COFF 7395@node Tag 7396@section @code{.tag @var{structname}} 7397 7398@cindex COFF structure debugging 7399@cindex structure debugging, COFF 7400@cindex @code{tag} directive 7401This directive is generated by compilers to include auxiliary debugging 7402information in the symbol table. It is only permitted inside 7403@code{.def}/@code{.endef} pairs. Tags are used to link structure 7404definitions in the symbol table with instances of those structures. 7405@end ifset 7406 7407@node Text 7408@section @code{.text @var{subsection}} 7409 7410@cindex @code{text} directive 7411Tells @command{@value{AS}} to assemble the following statements onto the end of 7412the text subsection numbered @var{subsection}, which is an absolute 7413expression. If @var{subsection} is omitted, subsection number zero 7414is used. 7415 7416@node Title 7417@section @code{.title "@var{heading}"} 7418 7419@cindex @code{title} directive 7420@cindex listing control: title line 7421Use @var{heading} as the title (second line, immediately after the 7422source file name and pagenumber) when generating assembly listings. 7423 7424This directive affects subsequent pages, as well as the current page if 7425it appears within ten lines of the top of a page. 7426 7427@ifset ELF 7428@node Tls_common 7429@section @code{.tls_common @var{symbol}, @var{length}[, @var{alignment}]} 7430 7431@cindex @code{tls_common} directive 7432This directive behaves in the same way as the @code{.comm} directive 7433(@pxref{Comm}) except that @var{symbol} has type of STT_TLS instead of 7434STT_OBJECT. 7435@end ifset 7436 7437@ifset COFF-ELF 7438@node Type 7439@section @code{.type} 7440 7441This directive is used to set the type of a symbol. 7442 7443@ifset COFF 7444@ifset ELF 7445@c only print the extra heading if both COFF and ELF are set 7446@subheading COFF Version 7447@end ifset 7448 7449@cindex COFF symbol type 7450@cindex symbol type, COFF 7451@cindex @code{type} directive (COFF version) 7452For COFF targets, this directive is permitted only within 7453@code{.def}/@code{.endef} pairs. It is used like this: 7454 7455@smallexample 7456.type @var{int} 7457@end smallexample 7458 7459This records the integer @var{int} as the type attribute of a symbol table 7460entry. 7461 7462@end ifset 7463 7464@ifset ELF 7465@ifset COFF 7466@c only print the extra heading if both COFF and ELF are set 7467@subheading ELF Version 7468@end ifset 7469 7470@cindex ELF symbol type 7471@cindex symbol type, ELF 7472@cindex @code{type} directive (ELF version) 7473For ELF targets, the @code{.type} directive is used like this: 7474 7475@smallexample 7476.type @var{name} , @var{type description} 7477@end smallexample 7478 7479This sets the type of symbol @var{name} to be either a 7480function symbol or an object symbol. There are five different syntaxes 7481supported for the @var{type description} field, in order to provide 7482compatibility with various other assemblers. 7483 7484Because some of the characters used in these syntaxes (such as @samp{@@} and 7485@samp{#}) are comment characters for some architectures, some of the syntaxes 7486below do not work on all architectures. The first variant will be accepted by 7487the GNU assembler on all architectures so that variant should be used for 7488maximum portability, if you do not need to assemble your code with other 7489assemblers. 7490 7491The syntaxes supported are: 7492 7493@smallexample 7494 .type <name> STT_<TYPE_IN_UPPER_CASE> 7495 .type <name>,#<type> 7496 .type <name>,@@<type> 7497 .type <name>,%<type> 7498 .type <name>,"<type>" 7499@end smallexample 7500 7501The types supported are: 7502 7503@table @gcctabopt 7504@item STT_FUNC 7505@itemx function 7506Mark the symbol as being a function name. 7507 7508@item STT_GNU_IFUNC 7509@itemx gnu_indirect_function 7510Mark the symbol as an indirect function when evaluated during reloc 7511processing. (This is only supported on assemblers targeting GNU systems). 7512 7513@item STT_OBJECT 7514@itemx object 7515Mark the symbol as being a data object. 7516 7517@item STT_TLS 7518@itemx tls_object 7519Mark the symbol as being a thread-local data object. 7520 7521@item STT_COMMON 7522@itemx common 7523Mark the symbol as being a common data object. 7524 7525@item STT_NOTYPE 7526@itemx notype 7527Does not mark the symbol in any way. It is supported just for completeness. 7528 7529@item gnu_unique_object 7530Marks the symbol as being a globally unique data object. The dynamic linker 7531will make sure that in the entire process there is just one symbol with this 7532name and type in use. (This is only supported on assemblers targeting GNU 7533systems). 7534 7535@end table 7536 7537Changing between incompatible types other than from/to STT_NOTYPE will 7538result in a diagnostic. An intermediate change to STT_NOTYPE will silence 7539this. 7540 7541Note: Some targets support extra types in addition to those listed above. 7542 7543@end ifset 7544@end ifset 7545 7546@node Uleb128 7547@section @code{.uleb128 @var{expressions}} 7548 7549@cindex @code{uleb128} directive 7550@var{uleb128} stands for ``unsigned little endian base 128.'' This is a 7551compact, variable length representation of numbers used by the DWARF 7552symbolic debugging format. @xref{Sleb128, ,@code{.sleb128}}. 7553 7554@ifset COFF 7555@node Val 7556@section @code{.val @var{addr}} 7557 7558@cindex @code{val} directive 7559@cindex COFF value attribute 7560@cindex value attribute, COFF 7561This directive, permitted only within @code{.def}/@code{.endef} pairs, 7562records the address @var{addr} as the value attribute of a symbol table 7563entry. 7564@end ifset 7565 7566@ifset ELF 7567@node Version 7568@section @code{.version "@var{string}"} 7569 7570@cindex @code{version} directive 7571This directive creates a @code{.note} section and places into it an ELF 7572formatted note of type NT_VERSION. The note's name is set to @code{string}. 7573@end ifset 7574 7575@ifset ELF 7576@node VTableEntry 7577@section @code{.vtable_entry @var{table}, @var{offset}} 7578 7579@cindex @code{vtable_entry} directive 7580This directive finds or creates a symbol @code{table} and creates a 7581@code{VTABLE_ENTRY} relocation for it with an addend of @code{offset}. 7582 7583@node VTableInherit 7584@section @code{.vtable_inherit @var{child}, @var{parent}} 7585 7586@cindex @code{vtable_inherit} directive 7587This directive finds the symbol @code{child} and finds or creates the symbol 7588@code{parent} and then creates a @code{VTABLE_INHERIT} relocation for the 7589parent whose addend is the value of the child symbol. As a special case the 7590parent name of @code{0} is treated as referring to the @code{*ABS*} section. 7591@end ifset 7592 7593@node Warning 7594@section @code{.warning "@var{string}"} 7595@cindex warning directive 7596Similar to the directive @code{.error} 7597(@pxref{Error,,@code{.error "@var{string}"}}), but just emits a warning. 7598 7599@node Weak 7600@section @code{.weak @var{names}} 7601 7602@cindex @code{weak} directive 7603This directive sets the weak attribute on the comma separated list of symbol 7604@code{names}. If the symbols do not already exist, they will be created. 7605 7606On COFF targets other than PE, weak symbols are a GNU extension. This 7607directive sets the weak attribute on the comma separated list of symbol 7608@code{names}. If the symbols do not already exist, they will be created. 7609 7610On the PE target, weak symbols are supported natively as weak aliases. 7611When a weak symbol is created that is not an alias, GAS creates an 7612alternate symbol to hold the default value. 7613 7614@node Weakref 7615@section @code{.weakref @var{alias}, @var{target}} 7616 7617@cindex @code{weakref} directive 7618This directive creates an alias to the target symbol that enables the symbol to 7619be referenced with weak-symbol semantics, but without actually making it weak. 7620If direct references or definitions of the symbol are present, then the symbol 7621will not be weak, but if all references to it are through weak references, the 7622symbol will be marked as weak in the symbol table. 7623 7624The effect is equivalent to moving all references to the alias to a separate 7625assembly source file, renaming the alias to the symbol in it, declaring the 7626symbol as weak there, and running a reloadable link to merge the object files 7627resulting from the assembly of the new source file and the old source file that 7628had the references to the alias removed. 7629 7630The alias itself never makes to the symbol table, and is entirely handled 7631within the assembler. 7632 7633@node Word 7634@section @code{.word @var{expressions}} 7635 7636@cindex @code{word} directive 7637This directive expects zero or more @var{expressions}, of any section, 7638separated by commas. 7639@ifclear GENERIC 7640@ifset W32 7641For each expression, @command{@value{AS}} emits a 32-bit number. 7642@end ifset 7643@ifset W16 7644For each expression, @command{@value{AS}} emits a 16-bit number. 7645@end ifset 7646@end ifclear 7647@ifset GENERIC 7648 7649The size of the number emitted, and its byte order, 7650depend on what target computer the assembly is for. 7651@end ifset 7652 7653@c on sparc the "special treatment to support compilers" doesn't 7654@c happen---32-bit addressability, period; no long/short jumps. 7655@ifset DIFF-TBL-KLUGE 7656@cindex difference tables altered 7657@cindex altered difference tables 7658@quotation 7659@emph{Warning: Special Treatment to support Compilers} 7660@end quotation 7661 7662@ifset GENERIC 7663Machines with a 32-bit address space, but that do less than 32-bit 7664addressing, require the following special treatment. If the machine of 7665interest to you does 32-bit addressing (or doesn't require it; 7666@pxref{Machine Dependencies}), you can ignore this issue. 7667 7668@end ifset 7669In order to assemble compiler output into something that works, 7670@command{@value{AS}} occasionally does strange things to @samp{.word} directives. 7671Directives of the form @samp{.word sym1-sym2} are often emitted by 7672compilers as part of jump tables. Therefore, when @command{@value{AS}} assembles a 7673directive of the form @samp{.word sym1-sym2}, and the difference between 7674@code{sym1} and @code{sym2} does not fit in 16 bits, @command{@value{AS}} 7675creates a @dfn{secondary jump table}, immediately before the next label. 7676This secondary jump table is preceded by a short-jump to the 7677first byte after the secondary table. This short-jump prevents the flow 7678of control from accidentally falling into the new table. Inside the 7679table is a long-jump to @code{sym2}. The original @samp{.word} 7680contains @code{sym1} minus the address of the long-jump to 7681@code{sym2}. 7682 7683If there were several occurrences of @samp{.word sym1-sym2} before the 7684secondary jump table, all of them are adjusted. If there was a 7685@samp{.word sym3-sym4}, that also did not fit in sixteen bits, a 7686long-jump to @code{sym4} is included in the secondary jump table, 7687and the @code{.word} directives are adjusted to contain @code{sym3} 7688minus the address of the long-jump to @code{sym4}; and so on, for as many 7689entries in the original jump table as necessary. 7690 7691@ifset INTERNALS 7692@emph{This feature may be disabled by compiling @command{@value{AS}} with the 7693@samp{-DWORKING_DOT_WORD} option.} This feature is likely to confuse 7694assembly language programmers. 7695@end ifset 7696@end ifset 7697@c end DIFF-TBL-KLUGE 7698 7699@ifclear no-space-dir 7700@node Zero 7701@section @code{.zero @var{size}} 7702 7703@cindex @code{zero} directive 7704@cindex filling memory with zero bytes 7705This directive emits @var{size} 0-valued bytes. @var{size} must be an absolute 7706expression. This directive is actually an alias for the @samp{.skip} directive 7707so it can take an optional second argument of the value to store in the bytes 7708instead of zero. Using @samp{.zero} in this way would be confusing however. 7709@end ifclear 7710 7711@node 2byte 7712@section @code{.2byte @var{expression} [, @var{expression}]*} 7713@cindex @code{2byte} directive 7714@cindex two-byte integer 7715@cindex integer, 2-byte 7716 7717This directive expects zero or more expressions, separated by commas. If there 7718are no expressions then the directive does nothing. Otherwise each expression 7719is evaluated in turn and placed in the next two bytes of the current output 7720section, using the endian model of the target. If an expression will not fit 7721in two bytes, a warning message is displayed and the least significant two 7722bytes of the expression's value are used. If an expression cannot be evaluated 7723at assembly time then relocations will be generated in order to compute the 7724value at link time. 7725 7726This directive does not apply any alignment before or after inserting the 7727values. As a result of this, if relocations are generated, they may be 7728different from those used for inserting values with a guaranteed alignment. 7729 7730@node 4byte 7731@section @code{.4byte @var{expression} [, @var{expression}]*} 7732@cindex @code{4byte} directive 7733@cindex four-byte integer 7734@cindex integer, 4-byte 7735 7736Like the @option{.2byte} directive, except that it inserts unaligned, four byte 7737long values into the output. 7738 7739@node 8byte 7740@section @code{.8byte @var{expression} [, @var{expression}]*} 7741@cindex @code{8byte} directive 7742@cindex eight-byte integer 7743@cindex integer, 8-byte 7744 7745For 64-bit architectures, or more generally with any GAS configured to support 774664-bit target virtual addresses, this is like the @option{.2byte} directive, 7747except that it inserts unaligned, eight byte long values into the output. 7748Otherwise, like @ref{Quad,,@code{.quad @var{expressions}}}, it expects zero or 7749more bignums, separated by commas. 7750 7751@node Deprecated 7752@section Deprecated Directives 7753 7754@cindex deprecated directives 7755@cindex obsolescent directives 7756One day these directives won't work. 7757They are included for compatibility with older assemblers. 7758@table @t 7759@item .abort 7760@item .line 7761@end table 7762 7763@ifset ELF 7764@node Object Attributes 7765@chapter Object Attributes 7766@cindex object attributes 7767 7768@command{@value{AS}} assembles source files written for a specific architecture 7769into object files for that architecture. But not all object files are alike. 7770Many architectures support incompatible variations. For instance, floating 7771point arguments might be passed in floating point registers if the object file 7772requires hardware floating point support---or floating point arguments might be 7773passed in integer registers if the object file supports processors with no 7774hardware floating point unit. Or, if two objects are built for different 7775generations of the same architecture, the combination may require the 7776newer generation at run-time. 7777 7778This information is useful during and after linking. At link time, 7779@command{@value{LD}} can warn about incompatible object files. After link 7780time, tools like @command{gdb} can use it to process the linked file 7781correctly. 7782 7783Compatibility information is recorded as a series of object attributes. Each 7784attribute has a @dfn{vendor}, @dfn{tag}, and @dfn{value}. The vendor is a 7785string, and indicates who sets the meaning of the tag. The tag is an integer, 7786and indicates what property the attribute describes. The value may be a string 7787or an integer, and indicates how the property affects this object. Missing 7788attributes are the same as attributes with a zero value or empty string value. 7789 7790Object attributes were developed as part of the ABI for the ARM Architecture. 7791The file format is documented in @cite{ELF for the ARM Architecture}. 7792 7793@menu 7794* GNU Object Attributes:: @sc{gnu} Object Attributes 7795* Defining New Object Attributes:: Defining New Object Attributes 7796@end menu 7797 7798@node GNU Object Attributes 7799@section @sc{gnu} Object Attributes 7800 7801The @code{.gnu_attribute} directive records an object attribute 7802with vendor @samp{gnu}. 7803 7804Except for @samp{Tag_compatibility}, which has both an integer and a string for 7805its value, @sc{gnu} attributes have a string value if the tag number is odd and 7806an integer value if the tag number is even. The second bit (@code{@var{tag} & 78072} is set for architecture-independent attributes and clear for 7808architecture-dependent ones. 7809 7810@subsection Common @sc{gnu} attributes 7811 7812These attributes are valid on all architectures. 7813 7814@table @r 7815@item Tag_compatibility (32) 7816The compatibility attribute takes an integer flag value and a vendor name. If 7817the flag value is 0, the file is compatible with other toolchains. If it is 1, 7818then the file is only compatible with the named toolchain. If it is greater 7819than 1, the file can only be processed by other toolchains under some private 7820arrangement indicated by the flag value and the vendor name. 7821@end table 7822 7823@subsection M680x0 Attributes 7824 7825@table @r 7826@item Tag_GNU_M68K_ABI_FP (4) 7827The floating-point ABI used by this object file. The value will be: 7828 7829@itemize @bullet 7830@item 78310 for files not affected by the floating-point ABI. 7832@item 78331 for files using double-precision hardware floating-point ABI. 7834@item 78352 for files using the software floating-point ABI. 7836@end itemize 7837@end table 7838 7839@subsection MIPS Attributes 7840 7841@table @r 7842@item Tag_GNU_MIPS_ABI_FP (4) 7843The floating-point ABI used by this object file. The value will be: 7844 7845@itemize @bullet 7846@item 78470 for files not affected by the floating-point ABI. 7848@item 78491 for files using the hardware floating-point ABI with a standard 7850double-precision FPU. 7851@item 78522 for files using the hardware floating-point ABI with a single-precision FPU. 7853@item 78543 for files using the software floating-point ABI. 7855@item 78564 for files using the deprecated hardware floating-point ABI which used 64-bit 7857floating-point registers, 32-bit general-purpose registers and increased the 7858number of callee-saved floating-point registers. 7859@item 78605 for files using the hardware floating-point ABI with a double-precision FPU 7861with either 32-bit or 64-bit floating-point registers and 32-bit 7862general-purpose registers. 7863@item 78646 for files using the hardware floating-point ABI with 64-bit floating-point 7865registers and 32-bit general-purpose registers. 7866@item 78677 for files using the hardware floating-point ABI with 64-bit floating-point 7868registers, 32-bit general-purpose registers and a rule that forbids the 7869direct use of odd-numbered single-precision floating-point registers. 7870@end itemize 7871 7872@item Tag_GNU_MIPS_ABI_MSA (8) 7873The MIPS SIMD Architecture (MSA) ABI used by this object file. The value 7874will be: 7875 7876@itemize @bullet 7877@item 78780 for files not affected by the MSA ABI. 7879@item 78801 for files using the 128-bit MSA ABI. 7881@end itemize 7882 7883@end table 7884 7885@subsection PowerPC Attributes 7886 7887@table @r 7888@item Tag_GNU_Power_ABI_FP (4) 7889The floating-point ABI used by this object file. The value will be: 7890 7891@itemize @bullet 7892@item 78930 for files not affected by the floating-point ABI. 7894@item 78951 for files using double-precision hardware floating-point ABI. 7896@item 78972 for files using the software floating-point ABI. 7898@item 78993 for files using single-precision hardware floating-point ABI. 7900@end itemize 7901 7902@item Tag_GNU_Power_ABI_Vector (8) 7903The vector ABI used by this object file. The value will be: 7904 7905@itemize @bullet 7906@item 79070 for files not affected by the vector ABI. 7908@item 79091 for files using general purpose registers to pass vectors. 7910@item 79112 for files using AltiVec registers to pass vectors. 7912@item 79133 for files using SPE registers to pass vectors. 7914@end itemize 7915@end table 7916 7917@subsection IBM z Systems Attributes 7918 7919@table @r 7920@item Tag_GNU_S390_ABI_Vector (8) 7921The vector ABI used by this object file. The value will be: 7922 7923@itemize @bullet 7924@item 79250 for files not affected by the vector ABI. 7926@item 79271 for files using software vector ABI. 7928@item 79292 for files using hardware vector ABI. 7930@end itemize 7931@end table 7932 7933@subsection MSP430 Attributes 7934 7935@table @r 7936@item Tag_GNU_MSP430_Data_Region (4) 7937The data region used by this object file. The value will be: 7938 7939@itemize @bullet 7940@item 79410 for files not using the large memory model. 7942@item 79431 for files which have been compiled with the condition that all 7944data is in the lower memory region, i.e. below address 0x10000. 7945@item 79462 for files which allow data to be placed in the full 20-bit memory range. 7947@end itemize 7948@end table 7949 7950@node Defining New Object Attributes 7951@section Defining New Object Attributes 7952 7953If you want to define a new @sc{gnu} object attribute, here are the places you 7954will need to modify. New attributes should be discussed on the @samp{binutils} 7955mailing list. 7956 7957@itemize @bullet 7958@item 7959This manual, which is the official register of attributes. 7960@item 7961The header for your architecture @file{include/elf}, to define the tag. 7962@item 7963The @file{bfd} support file for your architecture, to merge the attribute 7964and issue any appropriate link warnings. 7965@item 7966Test cases in @file{ld/testsuite} for merging and link warnings. 7967@item 7968@file{binutils/readelf.c} to display your attribute. 7969@item 7970GCC, if you want the compiler to mark the attribute automatically. 7971@end itemize 7972 7973@end ifset 7974 7975@ifset GENERIC 7976@node Machine Dependencies 7977@chapter Machine Dependent Features 7978 7979@cindex machine dependencies 7980The machine instruction sets are (almost by definition) different on 7981each machine where @command{@value{AS}} runs. Floating point representations 7982vary as well, and @command{@value{AS}} often supports a few additional 7983directives or command-line options for compatibility with other 7984assemblers on a particular platform. Finally, some versions of 7985@command{@value{AS}} support special pseudo-instructions for branch 7986optimization. 7987 7988This chapter discusses most of these differences, though it does not 7989include details on any machine's instruction set. For details on that 7990subject, see the hardware manufacturer's manual. 7991 7992@menu 7993@ifset AARCH64 7994* AArch64-Dependent:: AArch64 Dependent Features 7995@end ifset 7996@ifset ALPHA 7997* Alpha-Dependent:: Alpha Dependent Features 7998@end ifset 7999@ifset ARC 8000* ARC-Dependent:: ARC Dependent Features 8001@end ifset 8002@ifset ARM 8003* ARM-Dependent:: ARM Dependent Features 8004@end ifset 8005@ifset AVR 8006* AVR-Dependent:: AVR Dependent Features 8007@end ifset 8008@ifset Blackfin 8009* Blackfin-Dependent:: Blackfin Dependent Features 8010@end ifset 8011@ifset BPF 8012* BPF-Dependent:: BPF Dependent Features 8013@end ifset 8014@ifset CR16 8015* CR16-Dependent:: CR16 Dependent Features 8016@end ifset 8017@ifset CRIS 8018* CRIS-Dependent:: CRIS Dependent Features 8019@end ifset 8020@ifset CSKY 8021* C-SKY-Dependent:: C-SKY Dependent Features 8022@end ifset 8023@ifset D10V 8024* D10V-Dependent:: D10V Dependent Features 8025@end ifset 8026@ifset D30V 8027* D30V-Dependent:: D30V Dependent Features 8028@end ifset 8029@ifset EPIPHANY 8030* Epiphany-Dependent:: EPIPHANY Dependent Features 8031@end ifset 8032@ifset H8/300 8033* H8/300-Dependent:: Renesas H8/300 Dependent Features 8034@end ifset 8035@ifset HPPA 8036* HPPA-Dependent:: HPPA Dependent Features 8037@end ifset 8038@ifset I80386 8039* i386-Dependent:: Intel 80386 and AMD x86-64 Dependent Features 8040@end ifset 8041@ifset IA64 8042* IA-64-Dependent:: Intel IA-64 Dependent Features 8043@end ifset 8044@ifset IP2K 8045* IP2K-Dependent:: IP2K Dependent Features 8046@end ifset 8047@ifset LOONGARCH 8048* LoongArch-Dependent:: LoongArch Dependent Features 8049@end ifset 8050@ifset LM32 8051* LM32-Dependent:: LM32 Dependent Features 8052@end ifset 8053@ifset KVX 8054* KVX-Dependent:: KVX Dependent Features 8055@end ifset 8056@ifset M32C 8057* M32C-Dependent:: M32C Dependent Features 8058@end ifset 8059@ifset M32R 8060* M32R-Dependent:: M32R Dependent Features 8061@end ifset 8062@ifset M680X0 8063* M68K-Dependent:: M680x0 Dependent Features 8064@end ifset 8065@ifset M68HC11 8066* M68HC11-Dependent:: M68HC11 and 68HC12 Dependent Features 8067@end ifset 8068@ifset S12Z 8069* S12Z-Dependent:: S12Z Dependent Features 8070@end ifset 8071@ifset METAG 8072* Meta-Dependent :: Meta Dependent Features 8073@end ifset 8074@ifset MICROBLAZE 8075* MicroBlaze-Dependent:: MICROBLAZE Dependent Features 8076@end ifset 8077@ifset MIPS 8078* MIPS-Dependent:: MIPS Dependent Features 8079@end ifset 8080@ifset MMIX 8081* MMIX-Dependent:: MMIX Dependent Features 8082@end ifset 8083@ifset MSP430 8084* MSP430-Dependent:: MSP430 Dependent Features 8085@end ifset 8086@ifset NDS32 8087* NDS32-Dependent:: Andes NDS32 Dependent Features 8088@end ifset 8089@ifset NIOSII 8090* NiosII-Dependent:: Altera Nios II Dependent Features 8091@end ifset 8092@ifset NS32K 8093* NS32K-Dependent:: NS32K Dependent Features 8094@end ifset 8095@ifset OPENRISC 8096* OpenRISC-Dependent:: OpenRISC 1000 Features 8097@end ifset 8098@ifset PDP11 8099* PDP-11-Dependent:: PDP-11 Dependent Features 8100@end ifset 8101@ifset PJ 8102* PJ-Dependent:: picoJava Dependent Features 8103@end ifset 8104@ifset PPC 8105* PPC-Dependent:: PowerPC Dependent Features 8106@end ifset 8107@ifset PRU 8108* PRU-Dependent:: PRU Dependent Features 8109@end ifset 8110@ifset RISCV 8111* RISC-V-Dependent:: RISC-V Dependent Features 8112@end ifset 8113@ifset RL78 8114* RL78-Dependent:: RL78 Dependent Features 8115@end ifset 8116@ifset RX 8117* RX-Dependent:: RX Dependent Features 8118@end ifset 8119@ifset S390 8120* S/390-Dependent:: IBM S/390 Dependent Features 8121@end ifset 8122@ifset SCORE 8123* SCORE-Dependent:: SCORE Dependent Features 8124@end ifset 8125@ifset SH 8126* SH-Dependent:: Renesas / SuperH SH Dependent Features 8127@end ifset 8128@ifset SPARC 8129* Sparc-Dependent:: SPARC Dependent Features 8130@end ifset 8131@ifset TIC54X 8132* TIC54X-Dependent:: TI TMS320C54x Dependent Features 8133@end ifset 8134@ifset TIC6X 8135* TIC6X-Dependent :: TI TMS320C6x Dependent Features 8136@end ifset 8137@ifset TILEGX 8138* TILE-Gx-Dependent :: Tilera TILE-Gx Dependent Features 8139@end ifset 8140@ifset TILEPRO 8141* TILEPro-Dependent :: Tilera TILEPro Dependent Features 8142@end ifset 8143@ifset V850 8144* V850-Dependent:: V850 Dependent Features 8145@end ifset 8146@ifset VAX 8147* Vax-Dependent:: VAX Dependent Features 8148@end ifset 8149@ifset VISIUM 8150* Visium-Dependent:: Visium Dependent Features 8151@end ifset 8152@ifset WASM32 8153* WebAssembly-Dependent:: WebAssembly Dependent Features 8154@end ifset 8155@ifset XGATE 8156* XGATE-Dependent:: XGATE Dependent Features 8157@end ifset 8158@ifset XSTORMY16 8159* XSTORMY16-Dependent:: XStormy16 Dependent Features 8160@end ifset 8161@ifset XTENSA 8162* Xtensa-Dependent:: Xtensa Dependent Features 8163@end ifset 8164@ifset Z80 8165* Z80-Dependent:: Z80 Dependent Features 8166@end ifset 8167@ifset Z8000 8168* Z8000-Dependent:: Z8000 Dependent Features 8169@end ifset 8170@end menu 8171 8172@lowersections 8173@end ifset 8174 8175@c The following major nodes are *sections* in the GENERIC version, *chapters* 8176@c in single-cpu versions. This is mainly achieved by @lowersections. There is a 8177@c peculiarity: to preserve cross-references, there must be a node called 8178@c "Machine Dependencies". Hence the conditional nodenames in each 8179@c major node below. Node defaulting in makeinfo requires adjacency of 8180@c node and sectioning commands; hence the repetition of @chapter BLAH 8181@c in both conditional blocks. 8182 8183@ifset AARCH64 8184@include c-aarch64.texi 8185@end ifset 8186 8187@ifset ALPHA 8188@include c-alpha.texi 8189@end ifset 8190 8191@ifset ARC 8192@include c-arc.texi 8193@end ifset 8194 8195@ifset ARM 8196@include c-arm.texi 8197@end ifset 8198 8199@ifset AVR 8200@include c-avr.texi 8201@end ifset 8202 8203@ifset Blackfin 8204@include c-bfin.texi 8205@end ifset 8206 8207@ifset BPF 8208@include c-bpf.texi 8209@end ifset 8210 8211@ifset CR16 8212@include c-cr16.texi 8213@end ifset 8214 8215@ifset CRIS 8216@include c-cris.texi 8217@end ifset 8218 8219@ifset CSKY 8220@include c-csky.texi 8221@end ifset 8222 8223@ifset Renesas-all 8224@ifclear GENERIC 8225@node Machine Dependencies 8226@chapter Machine Dependent Features 8227 8228The machine instruction sets are different on each Renesas chip family, 8229and there are also some syntax differences among the families. This 8230chapter describes the specific @command{@value{AS}} features for each 8231family. 8232 8233@menu 8234* H8/300-Dependent:: Renesas H8/300 Dependent Features 8235* SH-Dependent:: Renesas SH Dependent Features 8236@end menu 8237@lowersections 8238@end ifclear 8239@end ifset 8240 8241@ifset D10V 8242@include c-d10v.texi 8243@end ifset 8244 8245@ifset D30V 8246@include c-d30v.texi 8247@end ifset 8248 8249@ifset EPIPHANY 8250@include c-epiphany.texi 8251@end ifset 8252 8253@ifset H8/300 8254@include c-h8300.texi 8255@end ifset 8256 8257@ifset HPPA 8258@include c-hppa.texi 8259@end ifset 8260 8261@ifset I80386 8262@include c-i386.texi 8263@end ifset 8264 8265@ifset IA64 8266@include c-ia64.texi 8267@end ifset 8268 8269@ifset IP2K 8270@include c-ip2k.texi 8271@end ifset 8272 8273@ifset LM32 8274@include c-lm32.texi 8275@end ifset 8276 8277@ifset LOONGARCH 8278@include c-loongarch.texi 8279@end ifset 8280 8281@ifset KVX 8282@include c-kvx.texi 8283@end ifset 8284 8285@ifset M32C 8286@include c-m32c.texi 8287@end ifset 8288 8289@ifset M32R 8290@include c-m32r.texi 8291@end ifset 8292 8293@ifset M680X0 8294@include c-m68k.texi 8295@end ifset 8296 8297@ifset M68HC11 8298@include c-m68hc11.texi 8299@end ifset 8300 8301@ifset S12Z 8302@include c-s12z.texi 8303@end ifset 8304 8305@ifset METAG 8306@include c-metag.texi 8307@end ifset 8308 8309@ifset MICROBLAZE 8310@include c-microblaze.texi 8311@end ifset 8312 8313@ifset MIPS 8314@include c-mips.texi 8315@end ifset 8316 8317@ifset MMIX 8318@include c-mmix.texi 8319@end ifset 8320 8321@ifset MSP430 8322@include c-msp430.texi 8323@end ifset 8324 8325@ifset NDS32 8326@include c-nds32.texi 8327@end ifset 8328 8329@ifset NIOSII 8330@include c-nios2.texi 8331@end ifset 8332 8333@ifset NS32K 8334@include c-ns32k.texi 8335@end ifset 8336 8337@ifset OPENRISC 8338@include c-or1k.texi 8339@end ifset 8340 8341@ifset PDP11 8342@include c-pdp11.texi 8343@end ifset 8344 8345@ifset PJ 8346@include c-pj.texi 8347@end ifset 8348 8349@ifset PPC 8350@include c-ppc.texi 8351@end ifset 8352 8353@ifset PRU 8354@include c-pru.texi 8355@end ifset 8356 8357@ifset RISCV 8358@include c-riscv.texi 8359@end ifset 8360 8361@ifset RL78 8362@include c-rl78.texi 8363@end ifset 8364 8365@ifset RX 8366@include c-rx.texi 8367@end ifset 8368 8369@ifset S390 8370@include c-s390.texi 8371@end ifset 8372 8373@ifset SCORE 8374@include c-score.texi 8375@end ifset 8376 8377@ifset SH 8378@include c-sh.texi 8379@end ifset 8380 8381@ifset SPARC 8382@include c-sparc.texi 8383@end ifset 8384 8385@ifset TIC54X 8386@include c-tic54x.texi 8387@end ifset 8388 8389@ifset TIC6X 8390@include c-tic6x.texi 8391@end ifset 8392 8393@ifset TILEGX 8394@include c-tilegx.texi 8395@end ifset 8396 8397@ifset TILEPRO 8398@include c-tilepro.texi 8399@end ifset 8400 8401@ifset V850 8402@include c-v850.texi 8403@end ifset 8404 8405@ifset VAX 8406@include c-vax.texi 8407@end ifset 8408 8409@ifset VISIUM 8410@include c-visium.texi 8411@end ifset 8412 8413@ifset WASM32 8414@include c-wasm32.texi 8415@end ifset 8416 8417@ifset XGATE 8418@include c-xgate.texi 8419@end ifset 8420 8421@ifset XSTORMY16 8422@include c-xstormy16.texi 8423@end ifset 8424 8425@ifset XTENSA 8426@include c-xtensa.texi 8427@end ifset 8428 8429@ifset Z80 8430@include c-z80.texi 8431@end ifset 8432 8433@ifset Z8000 8434@include c-z8k.texi 8435@end ifset 8436 8437@ifset GENERIC 8438@c reverse effect of @down at top of generic Machine-Dep chapter 8439@raisesections 8440@end ifset 8441 8442@node Reporting Bugs 8443@chapter Reporting Bugs 8444@cindex bugs in assembler 8445@cindex reporting bugs in assembler 8446 8447Your bug reports play an essential role in making @command{@value{AS}} reliable. 8448 8449Reporting a bug may help you by bringing a solution to your problem, or it may 8450not. But in any case the principal function of a bug report is to help the 8451entire community by making the next version of @command{@value{AS}} work better. 8452Bug reports are your contribution to the maintenance of @command{@value{AS}}. 8453 8454In order for a bug report to serve its purpose, you must include the 8455information that enables us to fix the bug. 8456 8457@menu 8458* Bug Criteria:: Have you found a bug? 8459* Bug Reporting:: How to report bugs 8460@end menu 8461 8462@node Bug Criteria 8463@section Have You Found a Bug? 8464@cindex bug criteria 8465 8466If you are not sure whether you have found a bug, here are some guidelines: 8467 8468@itemize @bullet 8469@cindex fatal signal 8470@cindex assembler crash 8471@cindex crash of assembler 8472@item 8473If the assembler gets a fatal signal, for any input whatever, that is a 8474@command{@value{AS}} bug. Reliable assemblers never crash. 8475 8476@cindex error on valid input 8477@item 8478If @command{@value{AS}} produces an error message for valid input, that is a bug. 8479 8480@cindex invalid input 8481@item 8482If @command{@value{AS}} does not produce an error message for invalid input, that 8483is a bug. However, you should note that your idea of ``invalid input'' might 8484be our idea of ``an extension'' or ``support for traditional practice''. 8485 8486@item 8487If you are an experienced user of assemblers, your suggestions for improvement 8488of @command{@value{AS}} are welcome in any case. 8489@end itemize 8490 8491@node Bug Reporting 8492@section How to Report Bugs 8493@cindex bug reports 8494@cindex assembler bugs, reporting 8495 8496A number of companies and individuals offer support for @sc{gnu} products. If 8497you obtained @command{@value{AS}} from a support organization, we recommend you 8498contact that organization first. 8499 8500You can find contact information for many support companies and 8501individuals in the file @file{etc/SERVICE} in the @sc{gnu} Emacs 8502distribution. 8503 8504@ifset BUGURL 8505In any event, we also recommend that you send bug reports for @command{@value{AS}} 8506to @value{BUGURL}. 8507@end ifset 8508 8509The fundamental principle of reporting bugs usefully is this: 8510@strong{report all the facts}. If you are not sure whether to state a 8511fact or leave it out, state it! 8512 8513Often people omit facts because they think they know what causes the problem 8514and assume that some details do not matter. Thus, you might assume that the 8515name of a symbol you use in an example does not matter. Well, probably it does 8516not, but one cannot be sure. Perhaps the bug is a stray memory reference which 8517happens to fetch from the location where that name is stored in memory; 8518perhaps, if the name were different, the contents of that location would fool 8519the assembler into doing the right thing despite the bug. Play it safe and 8520give a specific, complete example. That is the easiest thing for you to do, 8521and the most helpful. 8522 8523Keep in mind that the purpose of a bug report is to enable us to fix the bug if 8524it is new to us. Therefore, always write your bug reports on the assumption 8525that the bug has not been reported previously. 8526 8527Sometimes people give a few sketchy facts and ask, ``Does this ring a 8528bell?'' This cannot help us fix a bug, so it is basically useless. We 8529respond by asking for enough details to enable us to investigate. 8530You might as well expedite matters by sending them to begin with. 8531 8532To enable us to fix the bug, you should include all these things: 8533 8534@itemize @bullet 8535@item 8536The version of @command{@value{AS}}. @command{@value{AS}} announces it if you start 8537it with the @samp{--version} argument. 8538 8539Without this, we will not know whether there is any point in looking for 8540the bug in the current version of @command{@value{AS}}. 8541 8542@item 8543Any patches you may have applied to the @command{@value{AS}} source. 8544 8545@item 8546The type of machine you are using, and the operating system name and 8547version number. 8548 8549@item 8550What compiler (and its version) was used to compile @command{@value{AS}}---e.g. 8551``@code{gcc-2.7}''. 8552 8553@item 8554The command arguments you gave the assembler to assemble your example and 8555observe the bug. To guarantee you will not omit something important, list them 8556all. A copy of the Makefile (or the output from make) is sufficient. 8557 8558If we were to try to guess the arguments, we would probably guess wrong 8559and then we might not encounter the bug. 8560 8561@item 8562A complete input file that will reproduce the bug. If the bug is observed when 8563the assembler is invoked via a compiler, send the assembler source, not the 8564high level language source. Most compilers will produce the assembler source 8565when run with the @samp{-S} option. If you are using @code{@value{GCC}}, use 8566the options @samp{-v --save-temps}; this will save the assembler source in a 8567file with an extension of @file{.s}, and also show you exactly how 8568@command{@value{AS}} is being run. 8569 8570@item 8571A description of what behavior you observe that you believe is 8572incorrect. For example, ``It gets a fatal signal.'' 8573 8574Of course, if the bug is that @command{@value{AS}} gets a fatal signal, then we 8575will certainly notice it. But if the bug is incorrect output, we might not 8576notice unless it is glaringly wrong. You might as well not give us a chance to 8577make a mistake. 8578 8579Even if the problem you experience is a fatal signal, you should still say so 8580explicitly. Suppose something strange is going on, such as, your copy of 8581@command{@value{AS}} is out of sync, or you have encountered a bug in the C 8582library on your system. (This has happened!) Your copy might crash and ours 8583would not. If you told us to expect a crash, then when ours fails to crash, we 8584would know that the bug was not happening for us. If you had not told us to 8585expect a crash, then we would not be able to draw any conclusion from our 8586observations. 8587 8588@item 8589If you wish to suggest changes to the @command{@value{AS}} source, send us context 8590diffs, as generated by @code{diff} with the @samp{-u}, @samp{-c}, or @samp{-p} 8591option. Always send diffs from the old file to the new file. If you even 8592discuss something in the @command{@value{AS}} source, refer to it by context, not 8593by line number. 8594 8595The line numbers in our development sources will not match those in your 8596sources. Your line numbers would convey no useful information to us. 8597@end itemize 8598 8599Here are some things that are not necessary: 8600 8601@itemize @bullet 8602@item 8603A description of the envelope of the bug. 8604 8605Often people who encounter a bug spend a lot of time investigating 8606which changes to the input file will make the bug go away and which 8607changes will not affect it. 8608 8609This is often time consuming and not very useful, because the way we 8610will find the bug is by running a single example under the debugger 8611with breakpoints, not by pure deduction from a series of examples. 8612We recommend that you save your time for something else. 8613 8614Of course, if you can find a simpler example to report @emph{instead} 8615of the original one, that is a convenience for us. Errors in the 8616output will be easier to spot, running under the debugger will take 8617less time, and so on. 8618 8619However, simplification is not vital; if you do not want to do this, 8620report the bug anyway and send us the entire test case you used. 8621 8622@item 8623A patch for the bug. 8624 8625A patch for the bug does help us if it is a good one. But do not omit 8626the necessary information, such as the test case, on the assumption that 8627a patch is all we need. We might see problems with your patch and decide 8628to fix the problem another way, or we might not understand it at all. 8629 8630Sometimes with a program as complicated as @command{@value{AS}} it is very hard to 8631construct an example that will make the program follow a certain path through 8632the code. If you do not send us the example, we will not be able to construct 8633one, so we will not be able to verify that the bug is fixed. 8634 8635And if we cannot understand what bug you are trying to fix, or why your 8636patch should be an improvement, we will not install it. A test case will 8637help us to understand. 8638 8639@item 8640A guess about what the bug is or what it depends on. 8641 8642Such guesses are usually wrong. Even we cannot guess right about such 8643things without first using the debugger to find the facts. 8644@end itemize 8645 8646@node Acknowledgements 8647@chapter Acknowledgements 8648 8649If you have contributed to GAS and your name isn't listed here, 8650it is not meant as a slight. We just don't know about it. Send mail to the 8651maintainer, and we'll correct the situation. Currently 8652@c (October 2012), 8653the maintainer is Nick Clifton (email address @code{nickc@@redhat.com}). 8654 8655Dean Elsner wrote the original @sc{gnu} assembler for the VAX.@footnote{Any 8656more details?} 8657 8658Jay Fenlason maintained GAS for a while, adding support for GDB-specific debug 8659information and the 68k series machines, most of the preprocessing pass, and 8660extensive changes in @file{messages.c}, @file{input-file.c}, @file{write.c}. 8661 8662K. Richard Pixley maintained GAS for a while, adding various enhancements and 8663many bug fixes, including merging support for several processors, breaking GAS 8664up to handle multiple object file format back ends (including heavy rewrite, 8665testing, an integration of the coff and b.out back ends), adding configuration 8666including heavy testing and verification of cross assemblers and file splits 8667and renaming, converted GAS to strictly ANSI C including full prototypes, added 8668support for m680[34]0 and cpu32, did considerable work on i960 including a COFF 8669port (including considerable amounts of reverse engineering), a SPARC opcode 8670file rewrite, DECstation, rs6000, and hp300hpux host ports, updated ``know'' 8671assertions and made them work, much other reorganization, cleanup, and lint. 8672 8673Ken Raeburn wrote the high-level BFD interface code to replace most of the code 8674in format-specific I/O modules. 8675 8676The original VMS support was contributed by David L. Kashtan. Eric Youngdale 8677has done much work with it since. 8678 8679The Intel 80386 machine description was written by Eliot Dresselhaus. 8680 8681Minh Tran-Le at IntelliCorp contributed some AIX 386 support. 8682 8683The Motorola 88k machine description was contributed by Devon Bowen of Buffalo 8684University and Torbjorn Granlund of the Swedish Institute of Computer Science. 8685 8686Keith Knowles at the Open Software Foundation wrote the original MIPS back end 8687(@file{tc-mips.c}, @file{tc-mips.h}), and contributed Rose format support 8688(which hasn't been merged in yet). Ralph Campbell worked with the MIPS code to 8689support a.out format. 8690 8691Support for the Zilog Z8k and Renesas H8/300 processors (tc-z8k, 8692tc-h8300), and IEEE 695 object file format (obj-ieee), was written by 8693Steve Chamberlain of Cygnus Support. Steve also modified the COFF back end to 8694use BFD for some low-level operations, for use with the H8/300 and AMD 29k 8695targets. 8696 8697John Gilmore built the AMD 29000 support, added @code{.include} support, and 8698simplified the configuration of which versions accept which directives. He 8699updated the 68k machine description so that Motorola's opcodes always produced 8700fixed-size instructions (e.g., @code{jsr}), while synthetic instructions 8701remained shrinkable (@code{jbsr}). John fixed many bugs, including true tested 8702cross-compilation support, and one bug in relaxation that took a week and 8703required the proverbial one-bit fix. 8704 8705Ian Lance Taylor of Cygnus Support merged the Motorola and MIT syntax for the 870668k, completed support for some COFF targets (68k, i386 SVR3, and SCO Unix), 8707added support for MIPS ECOFF and ELF targets, wrote the initial RS/6000 and 8708PowerPC assembler, and made a few other minor patches. 8709 8710Steve Chamberlain made GAS able to generate listings. 8711 8712Hewlett-Packard contributed support for the HP9000/300. 8713 8714Jeff Law wrote GAS and BFD support for the native HPPA object format (SOM) 8715along with a fairly extensive HPPA testsuite (for both SOM and ELF object 8716formats). This work was supported by both the Center for Software Science at 8717the University of Utah and Cygnus Support. 8718 8719Support for ELF format files has been worked on by Mark Eichin of Cygnus 8720Support (original, incomplete implementation for SPARC), Pete Hoogenboom and 8721Jeff Law at the University of Utah (HPPA mainly), Michael Meissner of the Open 8722Software Foundation (i386 mainly), and Ken Raeburn of Cygnus Support (sparc, 8723and some initial 64-bit support). 8724 8725Linas Vepstas added GAS support for the ESA/390 ``IBM 370'' architecture. 8726 8727Richard Henderson rewrote the Alpha assembler. Klaus Kaempf wrote GAS and BFD 8728support for openVMS/Alpha. 8729 8730Timothy Wall, Michael Hayes, and Greg Smart contributed to the various tic* 8731flavors. 8732 8733David Heine, Sterling Augustine, Bob Wilson and John Ruttenberg from Tensilica, 8734Inc.@: added support for Xtensa processors. 8735 8736Several engineers at Cygnus Support have also provided many small bug fixes and 8737configuration enhancements. 8738 8739Jon Beniston added support for the Lattice Mico32 architecture. 8740 8741Many others have contributed large or small bugfixes and enhancements. If 8742you have contributed significant work and are not mentioned on this list, and 8743want to be, let us know. Some of the history has been lost; we are not 8744intentionally leaving anyone out. 8745 8746@node GNU Free Documentation License 8747@appendix GNU Free Documentation License 8748@include fdl.texi 8749 8750@node AS Index 8751@unnumbered AS Index 8752 8753@printindex cp 8754 8755@bye 8756@c Local Variables: 8757@c fill-column: 79 8758@c End: 8759