Bring in old fixes

This fixes two issuses in the interrupt handling routines.
First, the table index in for the data table pointer would be
overwritten with the handler function pointer.
Second, the interrupt_handler_add had a fencing error,
where entries would be entered into the table at an index
i - 1 instead while they are read at index i in the interrupt
handler.

newlib/ChangeLog.or1k:
2013-10-02  Stefan Kristiansson  <stefan.kristiansson@saunalahti.fi>

	* libc/machine/or1k/or1k-support-asm.S (interrupt_handler_add):
	Remove incorrect subtraction of handler table address.
	(interrupt_handler): Use seperate reg to hold function pointer.
sim/or1ksim: (sim_complete_command): Make char arguments const.

Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
fix mismerge from upstream sync

Omitting changelog on purpose on this one, since it really
should have been embedded in the merge.

All credit go to Franck Jullien for noticing and pin-pointing
the issue so quickly.
Solves a gettext dependency problem for libbfd.a on at least OSX Mountain Lion

GCC compilation fails because libbfd.a is not correctly linked to
gettext. The error is:

http://gcc.gnu.org/wiki/FAQ#Configuration_fails_with_.27.27configure:_error:_cannot_compute_suffix_of_object_files:_cannot_compile.27.27._What_is_the_problem.3F

And occurrs because the binutil tools fail with something like:
collect2: ld terminated with signal 5 [Trace/BPT trap]
dyld: lazy symbol binding failed: Symbol not found: _libintl_dgettext
  Referenced from: /Volumes/btc-
0.12/gcc-4.4/i386-apple-darwin9.8.0/powerpc-linux-gnu/lib/libb
fd-2.20.1.20100303.dylib
  Expected in: dynamic lookup

I found out that a link from libbfd.a to libintl.a had to be created
under the following url: http://www.telegraphics.com.au/~fthain/sw/build-
tool-chain/btc-20110616/patches/binutils-2.20.1-darwin-libbfd-link.diff

Although the workaround worked for GCC without newlib, it failed with it
because it was generating multiple definitions due to compiling
libintl.a into libbfd.a instead of linking.
Relevant libbfd.a compilation warning:
*** Warning: Linking the shared library libbfd.la against the
*** static library ../intl/libintl.a is not portable!

Giving a try to some reading about autobuild, I have came up with a
patch that worked under both cases (with and without newlib).
Make OSX fix darwin specific

It turns out that the fix to build or1k-src on OSX broke building on
other setups. The reason seems to be that on those systems, intl isn't built
and the link thus fails with a "ld: cannot find -lintl".
The real fix would probably be to check if intl is being built, and if
so apply the previous fix.
But until this is properly sorted out, only apply the fix for darwin
host builds.
or1k: newlib: Fix wrong order of insn in OR1K_DELAYED macro

The instruction that should be put in the delay slot should be
the first argument to the macro, not the other way around.

* newlib/ChangeLog.or1k
2013-10-27  Stefan Kristiansson  <stefan.kristiansson@saunalahti.fi>

	* libc/machine/or1k/or1k-support-asm.S (or1k_interrupt_handler):
	Change order of instructions in OR1K_DELAYED macro.