fix Xtensa assembler line numbers

Bob Wilson bwilson@tensilica.com
Mon Oct 17 18:16:00 GMT 2005


The recent changes to the ".loc" directive exposed some problems in the Xtensa 
port of GAS.  Because some Xtensa configurations allow multi-line VLIW 
instructions, we had been wrapping the dwarf2_directive_loc and dwarf2_emit_insn 
functions to set the line numbers to the first line of each instruction.  That 
was a pretty bad hack, and it didn't really work anymore.  This patch removes 
that hack and replaces it with a (hopefully) simpler one.  We just record the 
line numbers while parsing the Xtensa instructions, and then use 
new_logical_line to temporarily change the line number before calling 
dwarf2_emit_insn.  Tested with an xtensa-elf target and committed on the mainline.

2005-10-17  Bob Wilson  <bob.wilson@acm.org>

	* config/xtensa-istack.h (TInsn): Replace dwarf2_line_info with an
	unsigned line number.  Do not include "dwarf2dbg.h".
	* config/tc-xtensa.c (md_pseudo_table): Remove entry for "loc".
	(xtensa_dwarf2_directive_loc, xtensa_dwarf2_emit_insn): Delete.
	(xg_build_to_insn, xg_build_token_insn): Update TInsn uses.
	(md_assemble): Use as_where instead of dwarf2_where.
	(xg_assemble_vliw_tokens): Use unsigned line numbers instead of
	dwarf2_line_infos.  Change to call new_logical_line followed by
	dwarf2_emit_insn.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: gas-xtensa-linenums.diff
Type: text/x-patch
Size: 5200 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20051017/604c1299/attachment.bin>


More information about the Binutils mailing list