or1k: initial support for PIC

a lot of "inspiration" from lm32 and microblaze
or1k: handle relocs for R_OR1K_INSN_REL_26 (and R_OR1K_32)

needed to be able to reference sumbols in shared
libraries.
or1k: unset EMBEDDED for or1k_linux

When EMBEDDED=yes, "+ SIZEOF_HEADERS" is not added in
the linker script, but we need that to get PHDR placed
in the right spot
or1k: indentation ala gnu style (tabs and space mix)
or1k: rework plt entries
or1k: fill .got.plt entries with the address of plt0
or1k: fixup plt0 instruction word 1, not 2
or1k: Relocate R_OR1K_HI_16_IN_INSN and R_OR1K_LO_16_IN_INSN

This is needed for example in the case of a global variable
that needs to be marked with a R_OR1K_COPY relocation
or1k: read DT_RELASZ from ".rela.dyn"
or1k: make board globals weak

This way users can override them in their applications
if desired.

* libgloss/ChangeLog.or1k

2012-10-02  Stefan Kristiansson  <stefan.kristiansson@saunalahti.fi>

	* or1k/ml501.S: make board globals weak
	* or1k/or1ksim-uart.S: ditto
	* or1k/or1ksim.S: ditto
	* or1k/ordb1a3pe1500.S: ditto
	* or1k/ordb2a.S: ditto
	* or1k/orpsocrefdesign.S: ditto
or1k: add atlys and de0_nano boards

* libgloss/ChangeLog.or1k

2012-10-02  Stefan Kristiansson  <stefan.kristiansson@saunalahti.fi>

	* or1k/Makefile.in: add atlys and de0_nano to BOARDS
	* or1k/atlys.S: new file
	* or1k/de0_nano.S: ditto
or1k: remove halfbaked hi/lo(_GLOBAL_OFFSET_TABLE_) support

gotpchi/lo works well enough, so let's forget
about ever using hi/lo for this.
Merge https://github.com/openrisc/or1k-src into or1k
or1k: make board globals weak

This way users can override them in their applications
if desired.

* libgloss/ChangeLog.or1k

2012-10-02  Stefan Kristiansson  <stefan.kristiansson@saunalahti.fi>

	* or1k/ml501.S: make board globals weak
	* or1k/or1ksim-uart.S: ditto
	* or1k/or1ksim.S: ditto
	* or1k/ordb1a3pe1500.S: ditto
	* or1k/ordb2a.S: ditto
	* or1k/orpsocrefdesign.S: ditto
or1k: add atlys and de0_nano boards

* libgloss/ChangeLog.or1k

2012-10-02  Stefan Kristiansson  <stefan.kristiansson@saunalahti.fi>

	* or1k/Makefile.in: add atlys and de0_nano to BOARDS
	* or1k/atlys.S: new file
	* or1k/de0_nano.S: ditto
or1k: ld: Add elf32or1k_linux emulparams

* ld/ChangeLog.or1k

2012-10-24  Stefan Kristiansson  <stefan.kristiansson@saunalahti.fi>

	* emulparams/elf32or1k_linux.sh: New file.
	* Makefile.am (ALL_EMULATION_SOURCES): Add eelf32or1k_linux.c
	(eelf32or1k_linux.c): New rule.
	* Makefile.in: Regenerate.
	* configure.tgt: Use elf32or1k_linux for or1k(nd)-*-linux.
or1k: Add PIC relocs to include/elf/or1k.h

* include/ChangeLog.or1k

2012-10-24  Stefan Kristiansson  <stefan.kristiansson@saunalahti.fi>

	* elf/or1k.h (START_RELOC_NUMBERS): Add R_OR1K_GOTPC_HI16,
	R_OR1K_GOTPC_LO16, R_OR1K_GOT16, R_OR1K_PLT26, R_OR1K_GOTOFF_HI16,
	R_OR1K_GOTOFF_LO16, R_OR1K_COPY, R_OR1K_GLOB_DAT, R_OR1K_JMP_SLOT and
	R_OR1K_RELATIVE.
or1k: bfd: Add PIC support

* bfd/ChangeLog.or1k

2012-10-24  Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>

	* elf-bfd.h (elf_target_id): Add OR1K_ELF_DATA.
	* elf32-or1k.c (or1k_elf_howto_table): Add R_OR1K_GOTPC_HI16,
	R_OR1K_GOTPC_LO16, R_OR1K_GOT16, R_OR1K_PLT26, R_OR1K_GOTOFF_HI16,
	R_OR1K_GOTOFF_LO16, R_OR1K_COPY, R_OR1K_GLOB_DAT, R_OR1K_JMP_SLOT and
	R_OR1K_RELATIVE.
	(or1k_reloc_map): Add BFD_RELOC_OR1K_GOTPC_HI16,
	BFD_RELOC_OR1K_GOTPC_LO16, BFD_RELOC_OR1K_GOT16,
	BFD_RELOC_OR1K_PLT26, BFD_RELOC_OR1K_GOTOFF_HI16,
	BFD_RELOC_OR1K_GOTOFF_LO16, BFD_RELOC_OR1K_GLOB_DAT,
	BFD_RELOC_OR1K_COPY, BFD_RELOC_OR1K_JMP_SLOT and
	BFD_RELOC_OR1K_RELATIVE.
	(struct elf_or1k_dyn_relocs): New declaration.
	(struct elf_or1k_link_hash_entry): Likewise.
	(struct elf_or1k_link_hash_table): Likewise.
	(or1k_elf_link_hash_newfunc): New function.
	(or1k_elf_link_hash_table_create): Likewise.
	(or1k_elf_gc_sweep_hook): Likewise.
	(create_got_section): Likewise.
	(or1k_elf_finish_dynamic_sections): Likewise.
	(or1k_elf_finish_dynamic_symbol): Likewise.
	(or1k_elf_reloc_type_class): Likewise.
	(or1k_elf_adjust_dynamic_symbol): Likewise.
	(allocate_dynrelocs): Likewise.
	(readonly_dynrelocs): Likewise.
	(or1k_elf_size_dynamic_sections): Likewise.
	(or1k_elf_create_dynamic_sections): Likewise.
	(or1k_reloc_type_lookup): Add handling for R_OR1K_PLT26,
	R_OR1K_GOT16, R_OR1K_GOTOFF_LO16, R_OR1K_GOTOFF_HI16,
	R_OR1K_INSN_REL_26, R_OR1K_HI_16_IN_INSN, R_OR1K_LO_16_IN_INSN and
	R_OR1K_32.
	(or1k_elf_check_relocs): Likewise.
	* reloc.c (BFD_RELOC_OR1K_GOTPC_HI16): New relocation.
	(BFD_RELOC_OR1K_GOTPC_LO16): Likewise.
	(BFD_RELOC_OR1K_GOT16): Likewise.
	(BFD_RELOC_OR1K_PLT26): Likewise.
	(BFD_RELOC_OR1K_GOTOFF_HI16): Likewise.
	(BFD_RELOC_OR1K_GOTOFF_LO16): Likewise.
	(BFD_RELOC_OR1K_COPY): Likewise.
	(BFD_RELOC_OR1K_GLOB_DAT): Likewise.
	(BFD_RELOC_OR1K_JMP_SLOT): Likewise.
	(BFD_RELOC_OR1K_RELATIVE): Likewise.
	* bfd-in2.h: regenerate
or1k: gas: Add PIC support.

* gas/ChangeLog.or1k

2012-10-24  Stefan Kristiansson  <stefan.kristiansson@saunalahti.fi>

	* config/tc-or1k.c (tc_gen_reloc): New function. Handle
	BFD_RELOC_OR1K_GOTPC_HI16 and BFD_RELOC_OR1K_GOTPC_LO16 relocations
	to _GLOBAL_OFFSET_TABLE_
	* config/tc-or1k.h (tc_gen_reloc): Remove define.
or1k: cpu: Add PIC assembly keyword parsing.

* cpu/ChangeLog.or1k

2012-10-24  Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>

	* or1k.opc (parse_disp26): New function. Parsing for plt().
	(parse_simm16): Add parsing for got(), gotoffhi() and gotofflo().
	* or1korbis.cpu (disp26): Use custom handler.