make serial_ops const

I noticed that the serial_ops vtable is not const, but really it ought
to be.

This patch constifies it, removing the only mutable field in the
process.

Tested by rebuilding on x86-64 Fedora 18, both natively and using the
mingw cross tools.

2013-12-19  Tom Tromey  <tromey@redhat.com>

	* serial.c (serial_ops_p): New typedef.
	(serial_ops_list): Now a VEC.
	(serial_interface_lookup): Return const.  Use VEC_iterate.
	(serial_add_interface): Make parameter const.
	(serial_open): Update.
	(serial_fdopen_ops): Make 'ops' const.
	(serial_pipe): Update.
	* ser-tcp.c (_initialize_ser_tcp): Update.
	* ser-pipe.c (_initialize_ser_pipe): Update.
	* ser-unix.c (_initialize_ser_hardwire): Update.
	* ser-mingw.c (_initialize_ser_windows): Update.
	* ser-go32.c (dos_ops): Now const.  Update.
	* serial.h (struct serial) <ops>: Now const.
	(struct serial_ops) <next>: Remove.
	(serial_add_interface): Make parameter const.
don't allocate serial_ops

Now that struct serial_ops is const everywhere, we can easily turn the
instances into globals.  This patch implements this idea.

On the one hand I think this is nicer since it makes a bit more data
readonly and slightly reduces allocations.  On the other hand it
reduces readability somewhat.

If the readability is a concern to anyone I was thinking I could write
a macro that conditionally uses GCC's designated initializer
extension.

Tested by rebuilding on x86-64 Fedora 18, both natively and using the
mingw cross tools.

2013-12-19  Tom Tromey  <tromey@redhat.com>

	* ser-unix.c (hardwire_ops): New global.
	(_initialize_ser_hardwire): Use it.
	* ser-tcp.c (tcp_ops): New global.
	(_initialize_ser_tcp): Use it.
	* ser-pipe.c (pipe_ops): New global.
	(_initialize_ser_pipe): Use it.
	* ser-mingw.c (hardwire_ops, tty_ops, pipe_ops, tcp_ops): New
	globals.
	(_initialize_ser_windows): Use them.
  * Fix indentation issue and reorganize last commit entry
  so that it is shorter than 80.
  peXXigen.c (rsrc_cmp): Fix unused variable warning.
Fix PR breakpoints/16297: catch syscall with syscall 0

Code rationale
==============
by: Gabriel Krisman Bertazi

This is a fix for bug 16297. The problem occurs when the user attempts
to catch any syscall 0 (such as syscall read on Linux/x86_64). GDB was
not able to catch the syscall and was missing the breakpoint.

Now, breakpoint_hit_catch_syscall returns immediately when it finds the
correct syscall number, avoiding a following check for the end of the
search vector, that returns a no hit if the syscall number was zero.

Testcase rationale
==================
by: Sergio Durigan Junior

This testcase is a little difficult to write.  By doing a quick
inspection at the Linux source, one can see that, in many targets, the
syscall number 0 is restart_syscall, which is forbidden to be called
from userspace.  Therefore, on many targets, there's just no way to test
this safely.

My decision was to take the simpler route and just adds the "read"
syscall on the default test.  Its number on x86_64 is zero, which is
"good enough" since many people here do their tests on x86_64 anyway and
it is a popular architecture.

However, there was another little gotcha.  When using "read" passing 0
as the third parameter (i.e., asking it to read 0 bytes), current libc
implementations could choose not to effectively call the syscall.
Therefore, the best solution was to create a temporary pipe, write 1
byte into it, and then read this byte from it.

gdb/ChangeLog
2013-12-19  Gabriel Krisman Bertazi  <gabriel@krisman.be>

	PR breakpoints/16297
	* breakpoint.c (breakpoint_hit_catch_syscall): Return immediately
	when expected syscall is hit.

gdb/testsuite/ChangeLog
2013-12-19  Sergio Durigan Junior  <sergiodj@redhat.com>

	PR breakpoints/16297
	* gdb.base/catch-syscall.c (read_syscall, pipe_syscall)
	(write_syscall): New variables.
	(main): Create a pipe, write 1 byte in it, and read 1 byte from
	it.
	* gdb.base/catch-syscall.exp (all_syscalls): Include "pipe,
	"write" and "read" syscalls.
	(fill_all_syscalls_numbers): Improve the way to obtain syscalls
	numbers.
Don't run x86-64-disassem for mingw targets

mingw targets pad text sections which won't work with x86-64-disassem.

	* gas/i386/i386.exp: Don't run x86-64-disassem for mingw targets.
Set SHF_INFO_LINK bit for SHT_REL/SHT_RELA sections

It is a good pratice to set the SHF_INFO_LINK bit when the sh_info field
represents a section header index.

bfd/

	PR binutils/16317
	* elf.c (assign_section_numbers): Set the SHF_INFO_LINK bit for
	SHT_REL/SHT_RELA sections when setting the sh_info field.

binutils/testsuite/

	PR binutils/16317
	* binutils-all/readelf.s: Updated.
	* binutils-all/readelf.s-64: Likewise.

ld/testsuite/

	PR binutils/16317
	* ld-elf/linkinfo1.s: New file.
	* ld-elf/linkinfo1a.d: Likewise.
	* ld-elf/linkinfo1b.d: Likewise.