782
[darwin-xtools.git] / cctools / as / notes
blobba3390fbfeb4d00e592133278c6a2af7ea1418b3
1 TODO for coalesced symbols:
2 - Should external relocation entries for defined coalesced symbols only be
3   created with -dynamic and not -static?
5 TODO:
6 - Add MacOS line termination \r .
8 Known bugs:
9 - The assembly line:
10         bl ""foo""
11   causes the symbol name "" to be used.
12 - cmpwi seems to be the same as cmpi for PowerPC.
13 - Can't optimize because of compiler bug #50416 prevents line 235 in symbols.c
14   from working (currently has #pragma CC_OPT_OFF and  #pragma CC_OPT_RESUME
15   around that routine).
16 - The m88k instruction "tb0 0,r0,undef" trashes the instruction because of
17   the undefined.
18 - 68k does not handle packed immediates (the tables have been changed to dis-
19   allow this) because there is no routine to convert a flonum to a 68k packed
20   form.
21 - The logical operators && and || are not implemented.
23 Bugs to be fixed:
24 - The m68k "jmp @(_foo)" is not legal and needs to be flaged.
25 - The PowerPC extended branch mnemonic like beqlrl need to take a CRFONLY or
26   a number shifted over by 2 (like the fcmpu instruction).
28 Changes for the 5.28 release (the cctools-782 release):
29 - Added the .weak_def_can_be_hidden to read.c and changed colon() in symbols.c
30   to also preserve N_WEAK_DEF bit.  Radar bug #5021217.
31 - Fixed the arm assembler to correctly detect errors with floating point to
32   integer conversion instruction that use the rounding mode (vcvtr.*) when they
33   are not valid and generate an error.  The fix was in do_vfp_nsyn_cvtr() in
34   arm.c to cause an error if one has not already be caught by checking that
35   the flavour index into the static arrary enc[] does not have a null value.
36   Radar bug #7719236.
37 - Added the Intel aes instructions.  Radar bug #7709572.
39 Changes for the 5.28 release (the cctools-780 release):
40 - Changed the Makefile to use -Os for OFLAG in building the driver.
41 - Fixed a bug in parse_neon_mov() in arm.c that caused assembling:
42     vmov.f32 s2, s1
43   to end up with an undefined symbol named "s1" in the output file.  This was
44   caused by the call to parse_big_immediate().  Which was incorrectly called
45   before trying arm_typed_reg_parse().  The call to parse_big_immediate()
46   failed but as a side effect created the undefined symbol and then the later
47   call to arm_typed_reg_parse() did not fail.  Reversing the two removes the
48   problem and then in the case when parse_big_immediate() fails it causes an
49   error.  Radar bug #7567713.
50 - Fixed arm.c that incorrectly had an ARM_VARIANT set for the Thumb only
51   instructions cbnz and cbz.  Also fixed do_neon_mov() in arm.c when it was
52   called for something like "vshr q0,d0,#0" to not abort() in the switch(rs)
53   case for default if a inst.error and just return and let the error get
54   reported.  Radar bug #7559323.
56 Changes for the 5.28 release (the cctools-779 release):
57 - Changed the test in encode_thumb2_ldmstm() for the warning of the value
58   stored is UNPREDICTABLE to check that writeback is set before the rest of the
59   checks such as the base is in the list and is also not the lowest register
60   in the mask.  Radar bug #7528057.
62 Changes for the 5.28 release (the cctools-777 release):
63 - Changed round() to rnd() and stuff/round.h to stuff/rnd.h in all files and
64   removed -fno-builtin-round from the Makefile.  Radar bug #7475139.
65 - Changed the Makefile to use -Os for OFLAG.  Radar bug #7475093.
67 Changes for the 5.28 release (the cctools-775 release):
68 - Added support for the new arm ARM_RELOC_HALF and ARM_RELOC_HALF_SECTDIFF
69   relocation entries used with the movw and movt instruction immediates.
70   - Added a new file arm_reloc.h to have internal #defines for
71     ARM_{,THUMB_}RELOC_{LO16,HI16} with notes about the encodings for the
72     reloc entries in <mach-o/arm/reloc.h> .
73   - In arm.c assigned the enum BFD_RELOC_{ARM,THUMB}_MOV{W,T} values
74     ARM_{,THUMB_}RELOC_{LO16,HI16} from arm_reloc.h .
75   - Fixed the code in md_apply_fix() for the BFD_RELOC_{ARM,THUMB}_MOV{W,T}
76     case values so the *_MOVT values would have high 16 bits of the value used.
77   - Fixed the code in write_object.c to correctly deal with the ARM relocs.
78     - In nrelocs_for_fix() added the #ifdef ARM code for the paired relocs.
79     - In fix_to_relocation_entries() added the #ifdef ARM code for the handling
80       of the LO16,HI16 and SECTDIFF ARM relocs.
81   Radar bug #7421496.
83 Changes for the 5.28 release (the cctools-774 release):
84 - Added the invvpid and invept instructions to i386-opcode.h .
85   Radar bug #7383743.
86 - Fixed x86_64 instructions that have a 0xf2, 0xf3, etc. "mandatory" prefixes to
87   follow optional prefixes.   This is done by adding a entry in the i.prefix[]
88   array, increasing MAX_PREFIXES in i386.h by one and adding MAN_PREFIX just
89   before REX_PREFIX.  Then add_prefix() in i386.c had the parameter mandatory
90   added to it which was passed MAN_PREFIX when called with a mandatory prefix or
91   0 otherwise.  Then add_prefix() had code added to it to place the passed
92   prefix into i.prefix[mandatory] when mandatory was not zero and return 1
93   to indicate a prefix was added but was not a REP prefix.  Radar bug #7403143.
94 - Fixed the i386 bound instruction to take WordMem, WordReg not WordReg,
95   WordMem . Radar bug #7394709.
96 - Update the i386-check.c program to work for both i386 and x86_64 and added in
97   the Makefile an ax86_64_test target.
99 Changes for the 5.27 release (the cctools-772 release):
100 - Fixed the arm's assembler's vmls.f32 and vmls.f64 encodings, the changes were
101   in do_vfp_nsyn_mla_mls() in arm.c to use "fnmacs" instead of "fmscs" and
102   "fnmacd" instead of "fmscd".  Fixed the arm's assembler's vnmla.f32, vnmls.f32
103   and vnmla.f64, vnmls.f64 encoding in their respective table entries.
104   Radar bug #7331301.
105 - Changed the arm assembler to make the vcvt.* forms match the manual the same
106   as what was the vcvtz.* forms.  And removed the vcvtz.* forms.  Then added
107   the vcvtr.* forms as in the manual as what was the old vcvt.* forms.  Changes
108   were in do_vfp_nsyn_cvt() in arm.c in the last enc[] array entries and a
109   change to the "if (rs == NS_FF" to add "&& (flavour == 18 || flavour == 19))".
110   Then changed do_vfp_nsyn_cvtz() to do_vfp_nsyn_cvtr() and changed the entries
111   in the enc[] array in there.  And also changed the vcvt entry to use
112   vfp_nsyn_cvtr . Radar bug #7329319 & #7329326.
113 - Changed the arm assembler to allow "vmrs APSR_nzcv, FPSCR" by adding the
114   routine do_vmrs() in arm.c and changing the table entry for "vmrs" to allow
115   ASPR_RR for the first argument and use the new routine.  Radar bug #7327031.
116 - Changed i386_displacement() in i386.c and turned on the GCC_ASM_O_HACK to
117   allow displacements like "4+(%esp)".  Radar bug #5828463.
119 Changes for the 5.27 release (the cctools-771 release):
120 - Changed fixup_section() in layout.c for the first #if ARM case and removed the
121   check for the add symbol not being weak to set the low bit of the value.
122   Radar bug #7262421.
123 - Changed the test in encode_thumb2_ldmstm() for the warning of the value
124   stored is UNPREDICTABLE to check that the base is also not the lowest register
125   in the mask.  Radar bug #7268941.
127 Changes for the 5.27 release (the cctools-769 release):
128 - Fixed a bug in s_zerofill() in read.c that did not allow zerofill sizes
129   greater than 32-bits.  In s_zerofill() in read.c changed the local variable 
130   "size" to a uint64_t type.  Changed the type of the field "fr_address"
131   in the frag struct in frags.h to a uint64_t type.  And fixed types for
132   relax_addressT in relax.h which were reversed in the #ifdef ARCH64.
133   Radar bug #7245879.
135 Changes for the 5.27 release (the cctools-767 release):
136 - Added an error check for the call to realpath(3) in driver.c in main().
137   Radar bug #7201696.
139 Changes for the 5.27 release (the cctools-766 release):
140 - Picked up the change that never made it in the sources from cctools-685 but
141   made in in the notes below.  Changed relax_section() in layout.c in two plaves
142   #ifdef'ed ARM.  In the first look it now sets frag's relax_marker field to 
143   zero.  In the "Do relax" loop it flips the relax_marker field with an "^= 1".
144   This is to fix a problem in relaxed_symbol_addr() so it knows to add the
145   stretch amount to the addr it is returning.  Radar bug #7141908.
147 Changes for the 5.27 release (the cctools-765 release):
148 - Fixed a problem with the mask used for checking overflow of 2 byte values
149   in fixup_section() in layout.c that was 0xffff8000 which should have been
150   0xffff0000.  Also fixed the resulting error message so it would print the
151   source line number.  Radar bug #7114412.
152 - Added the assembly for the orn (immediate) instructions to arm.c in
153   t_do_orn().  Radar bug #7096522.
155 Changes for the 5.27 release (the cctools-763 release):
156 - Added the assembly for the orn instructions to arm.c .  Radar bug #7096522.
157 - Added the assembly for the rrx instructions to arm.c .  Radar bug #7098328.
159 Changes for the 5.27 release (the cctools-762 release):
160 - Changed the Makefile to set CC when when SDKROOT is set.  Radar bug #7078805.
161 - Changed output_relax_insn() in arm.c to allow symbols that are just an
162   absolute symbol.  As this occurs when using a symbol from .set for an
163   immediate value.  Radar bug #7069304.
165 Changes for the 5.27 release (the cctools-760 release):
166 - Changed the sources so the armv7 stuff is a no longer #ifndef __OPEN_SOURCE__
167   Radar bug #7016121.
168   - Changed the Makefile and removed the #ifndef __OPEN_SOURCE__ for the arm
169     build.
170   - Removed the #ifndef __OPEN_SOURCE__ from as.c that was bracketing armv7
171     the reference.
173 Changes for the 5.27 release (the cctools-759 release):
174 - Added the assembly for the pldw, vcvt.f32.f16, vcvt.f16.f32, vcvtt and
175   vcvtb instructions to arm.c .  Radar bug #6959129.
176 - Added the memory barrior options ish, ishst, osh, oshst, nsh and nshst
177   to arm.c . Radar bug #6982242.
178 - Changed the Makefile to add -isysroot $(SDKROOT) to compile and link lines
179   when SDKROOT is set.  Radar bug #6965029.
181 Changes for the 5.27 release (the cctools-758 release):
182 - Backed out the change in Radar bug #6511482 in the arm assembler to put out a
183   relocation entry for 32-bit thumb branches using the ARM_THUMB_32BIT_BRANCH
184   relocation type.
185   - Changed arm.c to no longer assign the enum type
186     BFD_RELOC_THUMB_PCREL_BRANCH20 to the ARM_THUMB_32BIT_BRANCH relocation
187     type's value.
188   - Changed nrelocs_for_fix() and fix_to_relocation_entries() in write_object.c
189     and removed the #ifdef ARM and tests for the ARM_THUMB_32BIT_BRANCH
190     relocation type when archflag_cpusubtype == CPU_SUBTYPE_ARM_V7.  That code
191     use to count 1 for the fixes in nrelocs_for_fix() and to put out a
192     relocation entry in fix_to_relocation_entries() for the type
193     ARM_THUMB_32BIT_BRANCH.  The relocation entry put out was a local relocation
194     entry that was pcrel, length of long and an symbolnum of R_ABS (0).
195     Also in fix_to_relocation_entries() it was setting fr_type to
196     ARM_THUMB_32BIT_BRANCH so that BFD_RELOC_THUMB_PCREL_BRANCH20 versions with
197     no symbol were geting set correctly.
198   Radar bug #6945428.
200 Changes for the 5.27 release (the cctools-757 release):
201 - Fixed the arm assembler to correctly place Rm in the rbit instruction in
202   both halfs of the 16 bit opcode.  The fix was is do_t_rbit() in arm.c .
203   Radar bug #6915130.
205 Changes for the 5.27 release (the cctools-754 release):
206 - Changed the arm assembler to allow -arch armv7 to accept ARMv7M special
207   registers.  The change was in md_begin() in arm.c for the case statement
208   CPU_SUBTYPE_ARM_V7. Radar bug #6782055.
210 Changes for the 5.27 release (the cctools-752 release):
211 - Ported to build with clang.
212   - Changed Makefile to work around bugs 6761248, 6756531 and 6756295.
213   - Added a (void) cast in the SKIP_WHITESPACE macro in read.h .
214   - Added (void) casts in the obstack_finish macro in obstack.h .
215   - Added (void) cast before obstack_finish() in:
216       frag_new() in frags.c
217       two places add_last_frags_to_sections() and two places in
218         layout_addresses() in layout.c 
219       section_new() in sections.c
220   - Added (void) case before obstack_1grow() in:
221       demand_copy_string(), s_macro(), s_endmacro(), add_to_macro_definition(),
222       expand_macro() and s_load() in read.c .
223   - Changed decode_local_label_name() in symbols.c so to use a literal string
224     instead of a pointer to a string to get rid of a "potentially insecure"
225     warning.
226   - Changed ppc.c and the use and setting of error_param_message so it is just
227     a string and not a format string to get rid of a "potentially insecure"
228     warning.  Workaround for 6765807.
229   - Fixed warnings about extra tokens at end of #endif directive in ofile.c
230     by putting them in a comment.
232 - Changed input_file_give_next_buffer() in input-file.[ch] to also return the
233   size of the buffer it will give.  Then changed input_scrub_next_buffer() in
234   input-scrub.c to use this to know when it didn't need to reallocate the
235   buffer to fix it from needlessly running out of memory.  Radar bug #6720994.
236 - Changed md_number_to_imm() in arm.c to have a case for 8 so .quad with a non-
237   relocatable expression would work.  Radar bug #6731807.
239 Changes for the 5.27 release (the cctools-751 release):
240 - Fixed a problem with the arm assembler not accepting the sdiv instruction with
241   armv7. Radar bug #6697528.
242 - Fixed an initialization problem in fix_new_internal() in fixes.c that was not
243   initializing the fx_sectdiff_divide_by_two field.  Radar bug #5930362.
245 Changes for the 5.26 release (the cctools-747 release):
246 - Changed the assembler to put out a line table if no .loc directives are
247   used but a .file directive to be used.  This was causing a bad dwarf for data
248   only files that used .file and had no .loc directives.  The fix is in
249   dwarf2_finish() in dwarf2dbg.c to add to the test to see we have seen any
250   line number segs or .file was used before calling out_debug_line().  Radar
251   bug #6593344.
253 Changes for the 5.26 release (the cctools-746 release):
254 - Added the support for the .sleb128 and .uleb128 directives.  Radar bug
255   #4545225.
256   - Added rs_leb128 to the relax_stateT enum in relax.h .
257   - Added the fields has_rs_leb128s and layout_pass to the frchain struct in
258     sections.h .
259   - Added entry for sleb128 and uleb128 to pseudo_table[] in read.c .
260   - Added s_leb128(), sizeof_uleb128, emit_leb128_expr() to read.c .
261     Where emit_leb128_expr() is heavily hacked from the original due to
262     differences in expressions.  In emit_leb128_expr() after the call to
263     frag_var() for a rs_leb128 frchain_now->has_rs_leb128s is set to TRUE to
264     mark the section as containing an rs_leb128 frag.
265   - Added a case label for rs_leb128 in the first loop in relax_section()
266     in layout.c with a line of code:
267         address += fragP->fr_offset = 1;
268   - Also added a case label for rs_leb128 in the second loop in relax_section()
269     in layout.c to get the value of the symbol's expression and call
270     sizeof_leb128() to get the current size, adjust the growth and save the new
271     size in the fr_offset field of the frag.
272   - Added code in layout_addresses() in layout.c to make three layout passes
273     over the frags.  Doing the debug sections last, ones with containing
274     rs_leb128 frags before that and all other sections first.
275   - Added a loop in the layout pass if relax_section() changes things.  To do
276     that the new field last_fr_address to the frag struct in frags.h, then
277     changed relax_section() in layout.c to return non-zero if the things change
278     by setting and testing the last_fr_address feild in each of the frags.
279   - Added a case label for rs_leb128 in layout_addresses() in layout.c and
280     code to get the value of the symbol's expression, then call output_leb128()
281     to place that value in the frag and finally convert the frag to an rs_fill
282     of the size of the bytes put in the frag.
284 Changes for the 5.26 release (the cctools-745 release):
285 - Changed the assembler to not put out a line table if no .loc directives are
286   used.  This was causing a second line table in the output with older compilers
287   causing bad dSYM files to be created.  The fix is in dwarf2_finish() in 
288   dwarf2dbg.c to test to see we have seen any line number segs before calling
289   out_debug_line().  Radar bug #6589056.
291 Changes for the 5.26 release (the cctools-744 release):
292 - Fixed a problem with the code to support .file/.loc which was incorrectly
293   putting out a Compile Unit into the debug_info section when it shouldn't.
294   The code in dwarf2_finish() in dwarf2dbg.c was not ported correctly for
295   checking if the debug_info section was empty.  It was testing the section
296   size for zero but that is not valid at that point in the code and needed
297   to look for fragments in the section.  So a version of the routine
298   seg_not_empty_p() was ported and added to sections.[ch] .  Radar bug #6573528.
300 Changes for the 5.26 release (the cctools-741 release):
301 - Fixed the encoding of the armv7 thumb2 instructions for where it places Rd in
302   qadd, qdadd, qsub and qdsub.  Added the do_t_rd_rm_rn() routine and changed
303   the opcode entries for these instructions to use them.  Radar bug #6522202.
305 Changes for the 5.26 release (the cctools-740 release):
306 - Removed the last abort() call in the reloc() routine in i386.c so user errors
307   do not appear like assembler crashes.  Radar bug #6516397.
309 Changes for the 5.26 release (the cctools-739 release):
310 - Changed the arm assembler to use 0x46c0 as the thumb1 nop pad for sections
311   with pure instructions.  The change was in s_align() in read.c.  Radar bug
312   #6517544.
314 Changes for the 5.26 release (the cctools-738 release):
315 - Removed the code and files for the old ProjectBuilder interface including the
316   use of mig(1) in the Makefile.  The files make.defs make_defs.h were removed
317   and the code in as.c and messages.[ch] with the OLD_PROJECTBUILDER_INTERFACE
318   #ifdef was removed.  Radar bug #6457206.
319 - Changed the arm assembler to put out a relocation entry for 32-bit thumb
320   branches using the new ARM_THUMB_32BIT_BRANCH relocation type.  Radar bug
321   #6511482.
322   - Changed arm.c to assign the enum type BFD_RELOC_THUMB_PCREL_BRANCH20 to
323     the new ARM_THUMB_32BIT_BRANCH relocation type's value.
324   - Changed nrelocs_for_fix() and fix_to_relocation_entries() in write_object.c
325     so there is an #ifdef ARM and tests for the new ARM_THUMB_32BIT_BRANCH
326     relocation type when archflag_cpusubtype == CPU_SUBTYPE_ARM_V7.  To count 1
327     for the fixes in nrelocs_for_fix() and to put out a relocation entry in
328     fix_to_relocation_entries() for the type ARM_THUMB_32BIT_BRANCH.  The
329     relocation entry put out is a local relocation entry that is pcrel, length
330     of long and an symbolnum of R_ABS (0).  Also in fix_to_relocation_entries()
331     it sets fr_type to ARM_THUMB_32BIT_BRANCH so that
332     BFD_RELOC_THUMB_PCREL_BRANCH20 versions with no symbol gets set correctly.
334 Changes for the 5.26 release (the cctools-737 release):
335 - Changed the logic in fixup_section() in layout.c to correctly not add the
336   value of the symbol into the item to be relocated if it is an external
337   coalesced symbol or weak symbol.  Radar bug #6505278.
338 - Changed frag_grow() in frags.c to not reduce the frags.chunk_size if 2 times
339   the number of bytes needed is less than that.  Radar bug #6490903.
340 - Changed the arm assembler to pad sections with pure instructions with nop's
341   other than zero bytes.  Radar bug #6492867.
342   - Changed arm.c and made the variable thumb_mode global and not static.
343   - Changed s_align() and added #ifdef ARM code to use specific nop values.
345 Changes for the 5.26 release (the cctools-736 release):
346 - Fixed misspelling of "can not" to "cannot" in 4 error messages in i386.c .
347   Radar bug #6447059.
348 - Fixed bugs in dwarf support:
349   - Changed layout_addresses() in layout.c to make two loops for calling
350     relax_section().  The first for non-debug sections so the sizes of their
351     sections are set before the second loop of the debug sections which might
352     have line number sections.  Radar bug #6460301.
353   - To get the old .file and dwarf .file to both work the trick is that
354     dwarf2_directive_file() parse the old .file directive stuff and pass
355     it to s_app_file() to make this work.
356      - This requires that dwarf2_directive_file is in md_pseudo_table[].
357      - Changed s_file() in read.[ch] to s_app_file().
358      - Changed the entry in the pseudo_table[] table from "file" to "appfile"
359        in read.c
360   - Changed process_entries() to return a non-zero value if it output something.
361   - Changed out_debug_line() to check the return value of process_entries() and
362     if nothing was outputted then output the a DW_LNE_set_address sequence to
363     set the address to zero and the DW_LNE_end_sequence.
364   - Changed dwarf2_finish() to also test files_in_use == 0 as part of its check
365     that there is no line information and no non-empty .debug_info section. Then
366     also added a check of all_segs == NULL before the check of
367     all_segs->next == NULL, and added this same set of checks before calling
368     out_debug_*() routines at the end.  This is need so the file table in the
369     line section is put out for something that has only data and no line
370     numbers.
371   - Changed fixup_section() in layout.c for x86_64 in debug sections to actually
372     set the value of the expression.
373   - Changed section_new() in sections.c to not set now_seg for section types
374     of S_ZEROFILL.
375   - Added the routine add_last_frags_to_sections() to layout.[ch] so that the
376     hacks in get_frag_fix() will work.  As get_frag_fix() will return 0 as the
377     size of the last frag in a section.
378   - Changed is_assembly_time_constant_subtraction_expression() in layout.c
379     to treat expression with symbols from a debug section with FAKE_LABEL_NAMEs
380     to be constant.
381   - Changed fixup_section() in layout.c when it has a section difference
382     relocatable subtraction where a symbol is at the end of a section and
383     the section it is relocating is a debug section as an assembly time constant
384     section if both symbols have FAKE_LABEL_NAMEs.
385   - Changed section_set() in sections.c to simply call section_new() to fix
386     the problems that it was not correctly setting frag_now and dropping the
387     the fragments from the sections frag chain.
388   - Fixed using basename() back to using lbasename() and added an lbasename()
389     routine just before get_filenum() which returns a pointer into the path
390     as expected by get_filenum().
391   - Fixed section_symbol() in symbols.c that was incorrectly testing
392     frcP->section_symbol != NULL when it should have been == NULL.
393   - Fixed the call to frag_align() in out_debug_aranges() in to pass the
394     fill prameters correctly so it does not crash.
395   - In read.c changed these routines:
396         sizeof_sleb128()
397         sizeof_uleb128()
398     to be two routines:
399         sizeof_sleb128_32() and sizeof_sleb128_64()
400         sizeof_uleb128_32() and sizeof_uleb128_64()
401     which has parameters of proper 32 and 64 bit signed types so when values of 
402     different types get passed they are correctly converted.  Without this it
403     will cause hangs as a shift of a negative value will be an arithmetic
404     shift and will never become zero.
405     - And added new sizeof_leb128() and sizeof_uleb128() routines that are
406       #ifdef'ed ARCH64 to call the correct sized and typed new routines.
407   - Changed relax_inc_line_addr() to not use make_expr_symbol() which is
408     ifdef'ed to abort, and changed it to use symbol_temp_new() and create a
409     SECT_DIFF expression in that symbol.
410   - Changed dwarf2dbg_estimate_size_before_relax() to match what
411     relax_inc_line_addr() creates and evaluate the symbol's expression before
412     the symbol values are set using their frag values.
413   - Changed dwarf2dbg_convert_frag() to match what relax_inc_line_addr() creates
414     and evaluate the symbol's expression after the symbol values are set.
415 - Hooked up the dwarf support for .loc and .file in the i386, ppc and arm
416   assemblers.  Radar bug #4298593.
417   - Removed the #ifndef NeXT_MOD in the md_pseudo_table[] in i386.c around the
418     .file and .loc directives that use dwarf2_directive_file() and
419     dwarf2_directive_loc() respectively.
420   - Removed the #ifdef OBJ_ELF in the md_pseudo_table[] in arm.c around the
421     .file, .loc and .loc_mark_labels directives that use dwarf2_directive_file()
422     dwarf2_directive_loc() and dwarf2_directive_loc_mark_labels() respectfully.
423   - Removed the #ifndef NeXT_MOD in output_insn() in i386.c around the call to
424     dwarf2_emit_insn() at the beginning of the routine.
425   - Removed the #ifdef OBJ_ELF in output_inst() in arm.c around the call to
426     dwarf2_emit_insn() at the end of the routine.
427   - Removed the #ifdef OBJ_ELF in output_relax_insn() in arm.c around the call
428     to dwarf2_emit_insn() at the beginning of the routine.
429   - Removed the #ifdef OBJ_ELF in arm_frob_label() in arm.c at the end of the
430     routine.
431   - Added a call to dwarf2_emit_insn() in md_assemble() in ppc.c after the
432     call to md_number_to_chars().
433   - Added a call to dwarf2_finish() in main() in as.c after the call to
434     perform_an_assembly_pass().
435   - Added a case label for rs_dwarf2dbg in layout_addresses() in layout.c 
436     with a line of code:
437         dwarf2dbg_convert_frag(fragP);
438   - Added a case label for rs_dwarf2dbg in the first loop in relax_section()
439     in layout.c with a line of code:
440         address += dwarf2dbg_estimate_size_before_relax(fragP);
441   - Added a case label for rs_dwarf2dbg in the second loop in relax_section()
442     in layout.c with a line of code:
443         growth = dwarf2dbg_relax_frag(fragP);
445 Changes for the 5.26 release (the cctools-733 release):
446 - Changed s_weak_definition() in read.c, colon() in symbols.c and
447   layout_symbols() in write_object.c to not check for the symbol defined as
448   not being in a coalesced section.  Then changed fix_to_relocation_entries()
449   in write_object.c to produce an external relocation entry if is is an external
450   coalesced symbol or weak symbol. And changed fixup_section() in layout.c to
451   not add the value of the symbol into the item to be relocated if it is an
452   external coalesced symbol or weak symbol.  Radar bug #6422713.
454 Changes for the 5.26 release (the cctools-731 release):
455 - Fixed s_thumb_set() in arm.c to set the N_ARM_THUMB_DEF bit in the sy_desc
456   field of the symbol.  Radar bug #6366869
458 Changes for the 5.26 release (the cctools-729 release):
459 - Put back in the change below and removed the #ifdef CHANGE_FOR_6233320 in
460   driver.c .  Radar bug #6233320.
462 Changes for the 5.26 release (the cctools-728 release):
463 - Changed arm_force_relocation() in arm.c so the the first if() conditional
464   includes the check for the relocation type BFD_RELOC_THUMB_PCREL_BRANCH25 to
465   cause it to generate a relocation entry for thumb2 b.w version of the branch.
466   Radar bug #6297258.
467 - Changed md_apply_fix() in arm.c in the BFD_RELOC_ARM_SWI case if conditonal
468   from this:
469         if (fixP->tc_fix_data != 0)
470   to:
471         if (*((int*)fixP->tc_fix_data) != 0)
472   Radar bug #6337904.
473 - Backed out the change below with an #ifdef CHANGE_FOR_6233320 in driver.c
474   for now.  Radar bug #6233320.
476 Changes for the 5.26 release (the cctools-727 release):
477 - Put back in the change below and removed the #ifdef CHANGE_FOR_6233320 in
478   driver.c .  Radar bug #6233320.
480 Changes for the 5.26 release (the cctools-724 release):
481 - Backed out the change below with an #ifdef CHANGE_FOR_6233320 in driver.c
482   for now.  Radar bug #6233320.
484 Changes for the 5.26 release (the cctools-723 release):
485 - Changed the assember driver, /usr/bin/as , when running on an Intel x86_64
486   host to default to -arch x86_64 instead of -arch i386.  The change was in
487   driver.c in main() after it finds no arch_name set and calls
488   get_arch_from_host().  A test for cputype == CPU_TYPE_I386 is made and if
489   true the arch_flag gets set to the family flag for CPU_TYPE_X86_64.  Radar
490   bug #6233320.
491 - radr://4545225 assembler should implement all dwarf-related GAS pseudo-ops
492   This is NOT yet hooked up as of cctools-723, but the code changes are put in
493   to top of tree to since they build and do not effect the operation of the
494   assembler's existing functionality.
495   - Moved now_seg definition from layout.c to sections.c and added the
496     definition of now_subseg to sections.c.  Added their declrations to
497     sections.h .
498   - Changed section_new() sections.c to always set now_seg as the value from
499     the frch_nsect field in the struct frchain for the current section.
500     now_subseg is always left with a value of zero.
501     - This is done so now_seg can be used dwarf2dbg.c for the seg field
502       of the struct line_seg. And letting now_subseg remain zero so there are
503       just one line_subseg per line_seg.
504   - Added the new routines get_section_by_nsect(), get_section_by_name() and
505     section_set() to sections.[ch] .
506   - Added dwarf2dbg.c from GAS and ported it:
507     - The routine dwarf2_finish() got a bit of a rewrite to deal with Mach-O
508       objects.  And now uses section_new() and get_section_by_name() to see if
509       it exists to replace the bfd_get_section_by_name() test.
510     - Changed the three uses of seg_info() to get_section_by_nsect() and
511       modified the code to use the returned struct frchain pointer.
512     - The routines to emit the dwarf sections: out_debug_line(),
513       out_debug_ranges(), out_debug_aranges(), out_debug_abbrev(),
514       out_debug_info() were changes to instead take segT parameters to take
515       struct frchain * parameters and there names changed to XXX_section from
516       XXX_seg.
517     - Changed subseg_set() to a new routine section_set() that was added to
518       change sections.
519     - Changed the call to resolve_symbol_value() in both
520       dwarf2dbg_estimate_size_before_relax() and dwarf2dbg_convert_frag()
521       to use the frag's values to calculate this.
522   - The use of O_subtract with expressionS and use of the X_op_symbol field for
523     the symbol value to subtract were change to use SEG_DIFFSECT and
524     X_subtract_symbol instead.
525   - Added rs_dwarf2dbg to relax_stateT enum in relax.h .
526   - Added a definition and declration of debug_type and enum debug_info_type
527     to as.[ch] and changed main() to set set debug_type to DEBUG_DWARF2 when
528     the argument --gdwarf2 is specified.
529   - Added an emit_expr() routine to dwarf2dbg.c based on the functionality of
530     the one in GAS's read.c but just for the ported uses in dwarf2dbg.c .
531   - Added to symbols.[ch] the routines: symbol_temp_new(),symbol_temp_new_now(),
532     symbol_temp_make() and symbol_set_value_now() needed in dwarf2dbg.c .
533   - Added a section_symbol field to the frchain struct in sections.h .
534   - Added to sections.[ch] section_symbol() to create and set a symbol at the
535     start of the section.
536 - Changed all the routines used in the poc_handler field of a pseudo_typeS to
537   change its parameter from int to uintptr_t to get rid of warnings.  See
538   Radar bug #6219587 below.
540 Changes for the 5.26 release (the cctools-722 release):
541 - Changed s_fill() in read.c to allow .fill with a size of 8.  Radar bug
542   #5783217.
544 Changes for the 5.26 release (the cctools-718 release):
545 - Fixed a bug in read.h which had an incorrect prameter type for the poc_handler
546   function pointer field of the pseudo_typeS typedef. The poc_val parameter was
547   an int type but is used to hold pointers so it needs to be a uintptr_t type.
548   Radar bug #6219587.
550 Changes for the 5.26 release (the cctools-716 release):
551 - Fixed a bug in s_zerofill() in read.c caused by the change in Radar bug
552   #6159238 where it needed to change to handle the case of an extra space after
553   the segment name before a comma in the parsing.  Radar bug #6195283.
554 - Fixed a bug in parse_neon_el_struct_list() in arm.c where it was loosing
555   the information about the index used for things like "d0[]" and making it
556   look like "d0".  In the loop to parse the argument list, in the is case
557   "{d0[]-d1[0]}" it called parse_typed_reg_or_scalar() which was passed 
558   pointer to a neon_typed_alias struct, atype, to fill in.  Then when it gets to
559   parsing the "-" it does not look at the atype.defined like the code after
560   the parsing of "-".  So that same bit of code which looks like:
561           if ((atype.defined & NTA_HASINDEX) != 0)
562             {
563               if (lane == -1)
564                 lane = atype.index;
565               else if (lane != atype.index)
566                 {
567                   first_error (_(type_error));
568                   return FAIL;
569                 }
570             }
571           else if (lane == -1)
572             ...
573   to match what is done after the the parsing of "-" so it does not lose the
574   information about the index of "d0[]".  What was happening for example was
575   this instruction:
576         vld1.f32 {d0[]-d1[]}, [r0]
577   was ending up as this instruction:
578         vld1.32 {d0-d1}, [r0]
579   Radar bug #6185952.
581 Changes for the 5.26 release (the cctools-715 release):
582 - Fixed the .thumb_set directive fails which was failing to parse its second
583   operand.  The fix was in s_thumb_set() to include the call to pseudo_set()
584   outside the #ifdef.  And to change pseudo_set() in read.[ch] to not be
585   static.  Radar bug #6182961.
586 - Fixed the handling of -force_cpusubtype_ALL for the arm assembler.  The code
587   near the end of md_begin() that tested for force_cpusubtype_ALL needed to
588   be changed to set the cpu_variant variable to allow everything and to set
589   archflag_cpusubtype to CPU_SUBTYPE_ARM_ALL as that is what will get set into
590   the resulting object file (not md_cpusubtype).  Radar bug #6150777.
591 - Fixed a problem with the change to Radar bug #4141844 where it was trying to
592   allow a prefix on the same line as the instruction without a separating shash,
593   '/', character.  The original change added a new "substate" variable to app.c.
594   But there were cases that it did not get set back it its initial value of zero
595   at the start of each line (state 0).  So to make this a bit more robust all
596   places where the state gets set back to zero the substate is also set to zero.
597   Radar bug #6159238.
599 Changes for the 5.26 release (the cctools-714 release):
600 - Added the arm instructions vmrs and vmsr to be the same as fmrx and fmxr in
601   arm.c .  Radar bug #6152739.
602 - Fixed a bug where the field sy_has_been_resolved in the symbol struct was
603   being used uninitialized.  The fix is in symbol_new() in symbols.c .
604   Radar bug #6163385.
606 Changes for the 5.26 release (the cctools-713 release):
607 - Changed an error message in md_apply_fix() for the BFD_RELOC_ARM_OFFSET_IMM8
608   case to use as_bad_where() not as_bad() so a file and line number gets 
609   printed.  Radar bug #5890008.
611 Changes for the 5.26 release (the cctools-711 release):
612 - Fixed a problem with getting the correct value of a difference of two symbols
613   that it was divided by 2 for 32-bit targets.  As the resulting value was
614   being calculated into a 64-bit signed type, signed_expr_t, with a += of an
615   expression of 2 32-bit unsigned types in fixup_section() in layout.c .
616   Radar bug #6096697.
618 Changes for the 5.26 release (the cctools-709 release):
619 - Fixed a problem with .quad expression values getting assembled with constants
620   larger than 32-bits being added to symbols.  Two places were using 32-bit
621   types, the offset field in the fix struct in fixes.h and the local variable
622   value in fixup_section() in layout.c .  Radar bug #5955044.
623 - Removed the call to abort() in reloc() in i386.c that should not be there
624   after a call to as_bad() to generate an error message.  Radar bug #6029941.
626 Changes for the 5.26 release (the cctools-706 release):
627 - Fixed a problem with the ported to run on 64-bit hosts, where changes to
628   atof-generic.c had 3 places change to uint32_t which should have been int32_t.
630 Changes for the 5.26 release (the cctools-705 release):
631 - Ported to run on 64-bit hosts.  Radar bug #6022298
633 Changes for the 5.26 release (the cctools-703 release):
634 - Added the .inlineasmstart and .inlineasmend directives to check that only
635   numeric lables are defined between them.  And if not generate an error message
636   from the arguments of the .inlineasmstart directive.  Radar bug #5896375.
637   - In read.c added the new routine s_inlineasm() and added it to the
638     pseudo_table[].  For the .inlineasmstart directive, s_inlineasm() is passed
639     a value of 1 and parses out the optional file_name, line_number and
640     column_number arguments.  When the .inlineasmstart directive is see it sets
641     the new inlineasm_checks variable and fills in the new variables
642     inlineasm_file_name, inlineasm_line_number and inlineasm_column_number with
643     the arguments.  And when the .inlineasmend directive is seen it clears
644     the new variables.  The new variables are defined in read.[ch].
645   - The routine colon(), in symbols.[ch], was changed to take a new parameter
646     local_colon that is set when called by local_colon.  And a test was added
647     if inlineasm_checks is set and local_colon() is not to cause an error.
648     If inlineasm_file_name is set then the new routine, in messages.[ch],
649     as_warn_where_with_column() is called else as_bad() is called to generate
650     the error message.
651   - The two plaves in read.c that call colon() had a 0 second argument added and
652     the call to colon() from local_colon() in symbols.c had a 1 second argument
653     added.
654 - Improved the x86_64 assembly time by caching the value of the linked list
655   search of x86_64_resolve_local_symbol() in i386.c.  Added two fields,
656   sy_has_been_resolved and sy_prev_resolved, to the symbol structure in
657   struc-symbol.h.  Radar bug #5902686.
659 Changes for the 5.26 release (the cctools-701 release):
660 - Fixed a problem in expr() in expr.c when it is combining a symbol that is a
661   set to a substract expression, SEG_DIFFSECT, with a constant.  In that case
662   it gets incorrectly combined to a SEG_ABSOLUTE instead of retaining the
663   SEG_DIFFSECT expression type.  Also Changed the x86_64 assembler to allow a
664   32-bit displacement operand as a symbol set to the subtraction of two
665   instructions.  Code was added in output_disp() in i386.c to test for this
666   specific case and create the needed fix for it.  Radar bug #5683920.
667 - Fixed a problem in pseudo_set() in read.c when it is setting a symbol to
668   another symbol that was already a section difference expression.  In that case
669   expression() returns an expression of just one symbol and a type of
670   SEG_DIFFSECT.  Code at the case for SEG_DIFFSECT needed to be added to handle
671   this case and copy the expression of the symbol in to the new symbol being
672   set.  Radar bug #5684077.
673 - Changed the x86_64 assembler to allow a 32-bit displacement operand as a
674   subtraction of two instructions.  Code was added in output_disp() in i386.c
675   to test for this specific case and create the needed relocation entries for
676   it.  Radar bug #5622258.
678 Changes for the 5.25 release (the cctools-697 release):
680 Changes for the 5.25 release (the cctools-689 release):
681 - Fixed a place that needed force_cpusubtype_ALL tested in md_assemble() in
682   arm.c . Radar bug #5817558.
683 - Added support for the special assembly time constant expression of the diff-
684   erence of two symbols defined in the same section then divided by exactly 2.
685   Radar bug #5819903.
686   - Added the field X_sectdiff_divide_by_two to the expressionS typedef in
687     expr.h .
688   - In expr() in expr.c added code to look for an expression with a SEG_DIFFSECT
689     and a left side with an SEG_ABSOLUTE X_add_number == 2 and a O_divide right
690     side and if so set the new X_sectdiff_divide_by_two field.
691   - Added the field fx_sectdiff_divide_by_two to the struct fix.
692   - Changed cons() in read.c to save the fix for a SEG_DIFFSECT and to copy the
693     the new X_sectdiff_divide_by_two field from the expression to the new
694     fx_sectdiff_divide_by_two field in the fix.
695   - In fixup_section() in layout.c added code to test the news
696     fx_sectdiff_divide_by_two field and if so divide the value by 2.  And check
697     to see that the expression is an assembly time constant.
699 Changes for the 5.25 release (the cctools-686 release):
700 - Changed arm_relax_frag() in arm.c to take a section number for the section it
701   is operating on.  That is in turn now passed to relax_branch() in arm.c and
702   in there if the symbol that is being branched to is not for that section it
703   returns 4 for the size of the instruction.
704 - In md_apply_fix() for BFD_RELOC_THUMB_PCREL_BRANCH25 the fx_r_type type is
705   set to BFD_RELOC_THUMB_PCREL_BRANCH23 so it can be output as a known
706   relocation type (ARM_THUMB_RELOC_BR22).
708 Changes for the 5.25 release (the cctools-685 release):
709 - Changed relaxed_symbol_addr() in arm.c to also add in
710   fragp->fr_symbol->sy_nlist.n_value when calculating the addr.  Without this
711   it can some times get "branch out of range" errors since it appears this
712   to have the address of the symbol from the start of the fragment.
713 - Changed the check in md_assemble() in arm.c for "width suffixes are invalid
714   in ARM mode" to allow them with unified syntax.
715 - Changed the arm APPLE LOCAL trap instruction opcode entry in arm.c from this:
716         CE(trap,        7ffdefe,  0, (), noargs),
717   to this:
718         TUE(trap,      7ffdefe, defe, 0, (), noargs, noargs),
719   which allows it to work with thumb mode.
720 - Changed relax_section() in layout.c in two plaves #ifdef'ed ARM.  In the first
721   look it now sets frag's relax_marker field to zero.  In the "Do relax" loop
722   it flips the relax_marker field with an "^= 1".  This is to fix a problem in
723   relaxed_symbol_addr() so it knows to add the stretch amount to the addr it
724   is returning.
725 - Added a second call to as_file_and_line() in frag_var() in frags.c which was
726   #ifdef ARM at the top of the file to set the fr_file and fr_line fields of
727   the current frag before creating a new frag.  This is needed because as the
728   line number of the last instruction which is the "relaxable" instruction is
729   the line number that is needed (not the first one).  So when relax_section()
730   calls arm_relax_frag() which calls md_convert_frag() it will call
731   fix_new_exp() and fix_new_internal() so a new fix may be created after all
732   code is read for the last instruction in the frag.  So md_convert_frag()
733   copies the fr_file and fr_line fields of the frag into the fx_file and fx_line
734   fields of the fix so line numbers can be reported.
736 Changes for the 5.25 release (the cctools-684 release):
737 - Changed relaxed_symbol_addr() in arm.c to not use the hack ported
738   S_GET_VALUE() as at that point the symbol does not have the value set.  The
739   code was #ifdef NOTYET to use fragp->fr_symbol->sy_frag->fr_address to get
740   the address from the symbol's frag.  The hack ported S_GET_VALUE() routine
741   was removed from symbols.[ch].
742 - Changed relax_addsub() where it had a memcpy() hack in place of the
743   #ifdef NOTYET out call to bfd_get_16() to a call to a call to 
744   md_chars_to_number() to retrive the old thumb opcode into op that
745   output_relax_insn() put into the frag.
746 - Added a call to as_file_and_line() in frag_var() in frags.c which was #ifdef
747   ARM to set the fr_file and fr_line fields of the frag.  This is needed because
748   when relax_section() calls arm_relax_frag() which calls md_convert_frag()
749   it will call fix_new_exp() and fix_new_internal() so a new fix will be created
750   after all code is read.  So md_convert_frag() copies the fr_file and fr_line
751   fields of the frag into the fx_file and fx_line fields of the fix so line
752   numbers can be reported.
754 Changes for the 5.25 release (the cctools-683 release):
755 - Fixed a bug in fix_new_arm() in arm.c after the call to fix_new_exp() before
756   the default: case label as missing a break; statement.
757 - Fixed a bug in relax_section() in layout.c for the "Do relax" loop where
758   the call to arm_relax_frag() should have set the variable growth not
759   incremented.  The "+=" was change to just an assignment, "=".
761 Changes for the 5.25 release (the cctools-682 release):
762 - Changed relax_section() in layout.c for the "Do relax" loop and #ifdef'ed
763   ARM the rs_machine_dependent case to call arm_relax_frag().
764 - Changed md_convert_frag() where it had a memcpy() hack in place of the
765   #ifdef NOTYET out call to bfd_get_16() to a call to a call to 
766   md_chars_to_number() to retrive the old thumb opcode into old_op that
767   output_relax_insn() put into the frag.
769 Changes for the 5.25 release (the cctools-681 release):
770 - Removed all __OPEN_SOURCE__ references in Makefile, notes, as.c, layout.c, 
771   messages.c, symbols.c, write_object.c, frags.h and symbols.h .
772 - Fixed a bug in the table entries for the pextrq and pinsrq instructions as
773   they should have had Size64 to force the REX.W byte.
774 - Fixed a bug in the table entries for the i386 SSE4.1 instruction insertps
775   where it had the second parameter as a general register not a xmm register.
776   The change was in i386-opcode.h to change Reg32 and Reg64 to RegXMM.
777   Radar bug #5650346.
778 - Changed output_relax_insn() in arm.c to just used the undefined symbol instead
779   of calling make_expr_symbol() if the expression is a just an undefined symbol
780   and no subtract symbol.
782 Changes for the 5.25 release (the cctools-680 release):