Commit: Add support for a temporary input line pointer in gas/read.c

Nick Clifton nickc@redhat.com
Thu Jan 12 14:55:00 GMT 2017


Hi Guys,

  I am checking in the attached patch to fix a internal assembler when
  gas is generating STABS output and it encounters a parsing error.  The
  problem was that the stabs functions would call the parsers in
  gas/read.c with a temporary input line pointer, but without setting
  the limit for this pointer.  So if a parsing error occurred, the
  assembler might attempt to read beyond the end of the temporary buffer
  which causes all kinds of problems.

  The patch solves the problem by adding a new function to gas/read.c to
  set a temporary input line pointer, and update the buffer_limit
  variable at the same time.  In this way the functions in stabs.c can
  safely create and use their temporary input line buffers.

  There are probably other places in gas where a temporary input line
  pointer is used and these functions would be helpful, but I have not
  investigated this yet.

Cheers
  Nick

gas/ChangeLog
2017-01-12  Nick Clifton  <nickc@redhat.com>

	* read.c (temp_ilp): New function.  Installs a temporary input
	line pointer.
	(restore_ilp): New function.  Restores the original input line
	pointer.
	* read.h (temp_ilp): Prototype.
	(restore_ilp): Prototype.
	* stabs.c (dot_func_p): Use bfd_boolean type.
	(generate_asm_file): Use temp_ilp and restore_ilp.
	(stabs_generate_asm_lineno): Likewise.
	(stabs_generate_asm_endfunc): Likewise.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gas.stabs.ilp.patch
Type: text/x-patch
Size: 6057 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20170112/19dd8f79/attachment.bin>


More information about the Binutils mailing list