public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  users/jkratoch/indexcxx-debugnames: Merge branch 'indexcxx' into indexcxx-debugnames
@ 2017-04-05 16:17 jkratoch
  0 siblings, 0 replies; 2+ messages in thread
From: jkratoch @ 2017-04-05 16:17 UTC (permalink / raw)
  To: archer-commits

The branch, users/jkratoch/indexcxx-debugnames has been updated
       via  9acf8358ad7b6f42e949596b2c7bc37a1e9ff8da (commit)
       via  828d7c2b97ad76c73c1a718d1bbaf434d045b937 (commit)
       via  2cad08ea7dbc96103da9957da6973f9d0dbc33a8 (commit)
       via  55a98976756cb2df83ac8f8e9799331fbcc4f669 (commit)
       via  8dea77f0254d6a76d71092c922e9409ef1b67df4 (commit)
       via  4ac40124eef08045bf99ad9f4fcc277961953109 (commit)
       via  4d5efb852be6554305dfaf17c1e4f07bb9514273 (commit)
       via  c053b65441eb70ac78a514fabc3431b857a30d2e (commit)
       via  f3b8f8ee35bd62a2ae7d21561f5d23f00dad004f (commit)
       via  80070c0d3491347f11283c5791b9dd040fedbd4f (commit)
       via  4c7bf4f91b7dd3ccbd12be55316fca8817059a24 (commit)
       via  1e1a8bef60db2f524c5eb1d27be22cfa9ff82a84 (commit)
       via  499079343549348e270047ffa2687a8a76523700 (commit)
       via  6f77053d2ae56f16c10a8817732ed9fb43893507 (commit)
       via  9c5417255690af00751c7d506172459afe856894 (commit)
       via  ecfb656c37b982479d8eb07f240b434772d98fd6 (commit)
       via  d194f1fe51cb85b8a919b7ee9e3a7715b0ec9744 (commit)
       via  fff8551cf549f4047c9276a836408d802db6ce6d (commit)
       via  477bdd393c8145ad44899cb4681d57a61c82aad3 (commit)
       via  a91e1603afb6704545793e967a1a3dfe96b389de (commit)
       via  b52920324fabbcad93042f2e17de52696d0dab42 (commit)
       via  65dd1e590e519eba10bc29fb6e952271e0604c9b (commit)
       via  d62a8ae2dd0fbb6235f4e8f2fb61b83fe4ba1d90 (commit)
       via  ad32986fdf9da1c8748e47b8b45100398223dba8 (commit)
       via  db3a1dc7c9404e203c54576db3335e69d995e83e (commit)
       via  4c220b4625df0b08cbb22e5c7ca04dc7a629de1b (commit)
       via  c41cf6fdf514fce6b69f8f875b6903b2a3910f89 (commit)
       via  2f5f29cada3c06c9c26f4da5994951effee7d6f7 (commit)
       via  2514e33e01890ad28023359b110d1c9c1ad201d4 (commit)
       via  46bed6796d5821832e8ba373ddb2e7fdc45a109d (commit)
       via  82156ab704b08b124d319c0decdbd48b3ca2dac5 (commit)
       via  75ec1fdbb797a389e4fe4aaf2e15358a070dcc19 (commit)
       via  f32ba72991d2406b21ab17edc234a2f3fa7fb23d (commit)
       via  12bfb8fec326e847f6300874ca656e47ee027f5d (commit)
       via  450b68da0169dcfa1c36987ec80e2655abb3f8e6 (commit)
       via  5e6a0e73317915b0685249606538ea739acc3a23 (commit)
      from  e7fd7db7d4406e5ebb9e4fe05bb38b2202cd8f98 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 9acf8358ad7b6f42e949596b2c7bc37a1e9ff8da
Merge: e7fd7db 828d7c2
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Apr 5 18:16:24 2017 +0200

    Merge branch 'indexcxx' into indexcxx-debugnames

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                        |   13 +
 bfd/ChangeLog                                    |   67 +
 bfd/Makefile.am                                  |    2 +
 bfd/Makefile.in                                  |    3 +
 bfd/config.bfd                                   |    6 +
 bfd/configure                                    |    2 +-
 bfd/configure.ac                                 |    2 +-
 bfd/elf-bfd.h                                    |   58 +
 bfd/elf-properties.c                             |  483 +++++++
 bfd/elf.c                                        |   69 +-
 bfd/elf32-i386.c                                 |   74 ++
 bfd/elf64-ppc.c                                  |   41 +-
 bfd/elf64-x86-64.c                               |   78 ++-
 bfd/elflink.c                                    |   35 +-
 bfd/elfnn-riscv.c                                |    9 +-
 bfd/elfxx-target.h                               |   12 +
 bfd/peXXigen.c                                   |   10 +-
 bfd/version.h                                    |    2 +-
 binutils/ChangeLog                               |   29 +
 binutils/NEWS                                    |    2 +
 binutils/readelf.c                               |   64 +-
 binutils/testsuite/binutils-all/mbind1.s         |   33 +
 binutils/testsuite/binutils-all/objcopy.exp      |    1 +
 config.sub                                       |    2 +-
 gas/ChangeLog                                    |   40 +
 gas/NEWS                                         |    2 +
 gas/config/obj-elf.c                             |   54 +-
 gas/config/obj-elf.h                             |    3 +-
 gas/config/tc-arm.c                              |    3 +-
 gas/config/tc-ia64.c                             |    2 +-
 gas/config/tc-microblaze.c                       |   18 +-
 gas/config/tc-mips.c                             |    2 +-
 gas/config/tc-msp430.c                           |    2 +-
 gas/config/tc-riscv.c                            |    2 +-
 gas/config/tc-rx.c                               |    4 +-
 gas/config/tc-tic6x.c                            |    3 +-
 gas/configure.tgt                                |    3 +
 gas/doc/as.texinfo                               |    2 +
 gas/testsuite/gas/elf/elf.exp                    |    3 +
 gas/testsuite/gas/elf/section10.d                |    4 +-
 gas/testsuite/gas/elf/section10.s                |    4 +-
 gas/testsuite/gas/elf/section12.s                |   33 +
 gas/testsuite/gas/elf/section12a.d               |   35 +
 gas/testsuite/gas/elf/section12b.d               |   32 +
 gas/testsuite/gas/elf/section13.d                |    2 +
 gas/testsuite/gas/elf/section13.l                |    2 +
 gas/testsuite/gas/elf/section13.s                |    2 +
 gdb/ChangeLog                                    |  172 +++
 gdb/MAINTAINERS                                  |    2 +-
 gdb/Makefile.in                                  |    8 +-
 gdb/NEWS                                         |    5 +
 gdb/alpha-fbsd-tdep.c                            |  132 --
 gdb/amd64-bsd-nat.c                              |   32 +-
 gdb/amd64-fbsd-tdep.c                            |   67 -
 gdb/common/gdb_optional.h                        |   34 +-
 gdb/common/offset-type.h                         |  149 +++
 gdb/common/preprocessor.h                        |   31 +
 gdb/common/traits.h                              |   34 +
 gdb/common/underlying.h                          |   32 +
 gdb/common/valid-expr.h                          |  108 ++
 gdb/config/alpha/fbsd.mh                         |    6 -
 gdb/configure.host                               |    4 +-
 gdb/configure.tgt                                |   11 +-
 gdb/dwarf2expr.c                                 |   45 +-
 gdb/dwarf2expr.h                                 |   16 +-
 gdb/dwarf2loc.c                                  |   37 +-
 gdb/dwarf2read.c                                 | 1530 +++++++++++-----------
 gdb/fbsd-nat.c                                   |    2 +-
 gdb/frame.c                                      |   58 +-
 gdb/gdbserver/ChangeLog                          |    4 +
 gdb/gdbserver/Makefile.in                        |    1 +
 gdb/gdbtypes.h                                   |   14 +-
 gdb/i386-fbsd-tdep.c                             |   59 -
 gdb/remote.c                                     |   10 +-
 gdb/testsuite/gdb.threads/thread-specific-bp.exp |    9 +-
 gdb/unittests/offset-type-selftests.c            |  178 +++
 include/ChangeLog                                |   11 +
 include/elf/common.h                             |    7 +
 include/elf/riscv.h                              |    3 +
 ld/ChangeLog                                     |   76 ++
 ld/NEWS                                          |    4 +
 ld/configure.tgt                                 |    1 +
 ld/emultempl/elf32.em                            |   48 +-
 ld/ldlang.c                                      |    2 +
 ld/testsuite/ld-elf/elf.exp                      |   21 +
 ld/testsuite/ld-elf/mbind1.s                     |   43 +
 ld/testsuite/ld-elf/mbind1a.d                    |   44 +
 ld/testsuite/ld-elf/mbind1b.d                    |   44 +
 ld/testsuite/ld-elf/mbind1c.d                    |   44 +
 ld/testsuite/ld-elf/mbind2a.s                    |   15 +
 ld/testsuite/ld-elf/mbind2b.c                    |   17 +
 ld/testsuite/ld-elf/pr21233-e.ld                 |    2 +
 ld/testsuite/ld-elf/pr21233-l.s                  |    6 +
 ld/testsuite/ld-elf/pr21233-l.sd                 |    6 +
 ld/testsuite/ld-elf/pr21233.ld                   |   17 +
 ld/testsuite/ld-elf/pr21233.s                    |    8 +
 ld/testsuite/ld-elf/pr21233.sd                   |    9 +
 ld/testsuite/ld-elf/shared.exp                   |   40 +
 ld/testsuite/ld-i386/i386.exp                    |  273 ++++
 ld/testsuite/ld-i386/pass.c                      |    8 +
 ld/testsuite/ld-i386/property-1.r                |    7 +
 ld/testsuite/ld-i386/property-2.r                |    7 +
 ld/testsuite/ld-i386/property-3.r                |    8 +
 ld/testsuite/ld-i386/property-4.r                |    8 +
 ld/testsuite/ld-i386/property-5.r                |    8 +
 ld/testsuite/ld-i386/property-6.r                |    7 +
 ld/testsuite/ld-i386/property-6a.c               |    7 +
 ld/testsuite/ld-i386/property-6b.c               |    8 +
 ld/testsuite/ld-i386/property-6c.S               |   18 +
 ld/testsuite/ld-i386/property-7.r                |    6 +
 ld/testsuite/ld-i386/property-no-copy.S          |   15 +
 ld/testsuite/ld-i386/property-stack.S            |   18 +
 ld/testsuite/ld-i386/property-unsorted-1.S       |   34 +
 ld/testsuite/ld-i386/property-unsorted-2.S       |   22 +
 ld/testsuite/ld-i386/property-x86-1.S            |   32 +
 ld/testsuite/ld-i386/property-x86-2.S            |   25 +
 ld/testsuite/ld-x86-64/pass.c                    |    8 +
 ld/testsuite/ld-x86-64/property-1.r              |    7 +
 ld/testsuite/ld-x86-64/property-2.r              |    7 +
 ld/testsuite/ld-x86-64/property-3.r              |    8 +
 ld/testsuite/ld-x86-64/property-4.r              |    8 +
 ld/testsuite/ld-x86-64/property-5.r              |    8 +
 ld/testsuite/ld-x86-64/property-6.r              |    7 +
 ld/testsuite/ld-x86-64/property-6a.c             |    7 +
 ld/testsuite/ld-x86-64/property-6b.c             |    8 +
 ld/testsuite/ld-x86-64/property-6c.S             |   23 +
 ld/testsuite/ld-x86-64/property-7.r              |    6 +
 ld/testsuite/ld-x86-64/property-no-copy.S        |   20 +
 ld/testsuite/ld-x86-64/property-stack.S          |   23 +
 ld/testsuite/ld-x86-64/property-unsorted-1.S     |   39 +
 ld/testsuite/ld-x86-64/property-unsorted-2.S     |   27 +
 ld/testsuite/ld-x86-64/property-x86-1.S          |   37 +
 ld/testsuite/ld-x86-64/property-x86-2.S          |   30 +
 ld/testsuite/ld-x86-64/x86-64.exp                |  273 ++++
 opcodes/ChangeLog                                |    5 +
 opcodes/riscv-dis.c                              |    2 +-
 136 files changed, 4450 insertions(+), 1226 deletions(-)
 create mode 100644 bfd/elf-properties.c
 create mode 100644 binutils/testsuite/binutils-all/mbind1.s
 create mode 100644 gas/testsuite/gas/elf/section12.s
 create mode 100644 gas/testsuite/gas/elf/section12a.d
 create mode 100644 gas/testsuite/gas/elf/section12b.d
 create mode 100644 gas/testsuite/gas/elf/section13.d
 create mode 100644 gas/testsuite/gas/elf/section13.l
 create mode 100644 gas/testsuite/gas/elf/section13.s
 delete mode 100644 gdb/alpha-fbsd-tdep.c
 create mode 100644 gdb/common/offset-type.h
 create mode 100644 gdb/common/preprocessor.h
 create mode 100644 gdb/common/traits.h
 create mode 100644 gdb/common/underlying.h
 create mode 100644 gdb/common/valid-expr.h
 delete mode 100644 gdb/config/alpha/fbsd.mh
 create mode 100644 gdb/unittests/offset-type-selftests.c
 create mode 100644 ld/testsuite/ld-elf/mbind1.s
 create mode 100644 ld/testsuite/ld-elf/mbind1a.d
 create mode 100644 ld/testsuite/ld-elf/mbind1b.d
 create mode 100644 ld/testsuite/ld-elf/mbind1c.d
 create mode 100644 ld/testsuite/ld-elf/mbind2a.s
 create mode 100644 ld/testsuite/ld-elf/mbind2b.c
 create mode 100644 ld/testsuite/ld-elf/pr21233-e.ld
 create mode 100644 ld/testsuite/ld-elf/pr21233-l.s
 create mode 100644 ld/testsuite/ld-elf/pr21233-l.sd
 create mode 100644 ld/testsuite/ld-elf/pr21233.ld
 create mode 100644 ld/testsuite/ld-elf/pr21233.s
 create mode 100644 ld/testsuite/ld-elf/pr21233.sd
 create mode 100644 ld/testsuite/ld-i386/pass.c
 create mode 100644 ld/testsuite/ld-i386/property-1.r
 create mode 100644 ld/testsuite/ld-i386/property-2.r
 create mode 100644 ld/testsuite/ld-i386/property-3.r
 create mode 100644 ld/testsuite/ld-i386/property-4.r
 create mode 100644 ld/testsuite/ld-i386/property-5.r
 create mode 100644 ld/testsuite/ld-i386/property-6.r
 create mode 100644 ld/testsuite/ld-i386/property-6a.c
 create mode 100644 ld/testsuite/ld-i386/property-6b.c
 create mode 100644 ld/testsuite/ld-i386/property-6c.S
 create mode 100644 ld/testsuite/ld-i386/property-7.r
 create mode 100644 ld/testsuite/ld-i386/property-no-copy.S
 create mode 100644 ld/testsuite/ld-i386/property-stack.S
 create mode 100644 ld/testsuite/ld-i386/property-unsorted-1.S
 create mode 100644 ld/testsuite/ld-i386/property-unsorted-2.S
 create mode 100644 ld/testsuite/ld-i386/property-x86-1.S
 create mode 100644 ld/testsuite/ld-i386/property-x86-2.S
 create mode 100644 ld/testsuite/ld-x86-64/pass.c
 create mode 100644 ld/testsuite/ld-x86-64/property-1.r
 create mode 100644 ld/testsuite/ld-x86-64/property-2.r
 create mode 100644 ld/testsuite/ld-x86-64/property-3.r
 create mode 100644 ld/testsuite/ld-x86-64/property-4.r
 create mode 100644 ld/testsuite/ld-x86-64/property-5.r
 create mode 100644 ld/testsuite/ld-x86-64/property-6.r
 create mode 100644 ld/testsuite/ld-x86-64/property-6a.c
 create mode 100644 ld/testsuite/ld-x86-64/property-6b.c
 create mode 100644 ld/testsuite/ld-x86-64/property-6c.S
 create mode 100644 ld/testsuite/ld-x86-64/property-7.r
 create mode 100644 ld/testsuite/ld-x86-64/property-no-copy.S
 create mode 100644 ld/testsuite/ld-x86-64/property-stack.S
 create mode 100644 ld/testsuite/ld-x86-64/property-unsorted-1.S
 create mode 100644 ld/testsuite/ld-x86-64/property-unsorted-2.S
 create mode 100644 ld/testsuite/ld-x86-64/property-x86-1.S
 create mode 100644 ld/testsuite/ld-x86-64/property-x86-2.S

First 500 lines of diff:
diff --git a/ChangeLog b/ChangeLog
index 8565325..bb87497 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2017-04-03  Andrew Jenner  <andrew@codesourcery.com>
+
+	* config.sub: Handle ia16 in $basic_machine.
+
+	bfd/
+	* config.bfd: Handle ia16.
+
+	gas/
+	* configure.tgt: Handle ia16.
+
+	ld/
+	* configure.tgt: Handle ia16.
+
 2017-03-22  Nick Clifton  <nickc@redhat.com>
 
 	* config.sub: Sync with master version in config project.
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index bb851c7..0e4ad30 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,70 @@
+2017-04-05  Alan Modra  <amodra@gmail.com>
+
+	* elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
+	reference counting.
+
+2017-04-02  Jon Turney  <jon.turney@dronecode.org.uk>
+
+	(_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
+	numbers for DataDirectory entry indicies passed to
+	add_data_entry().
+
+2017-04-04  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elf.c (get_program_header_size): Add a GNU_MBIND segment for
+	each GNU_MBIND section and align GNU_MBIND section to page size.
+	(_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
+	segment for each GNU_MBIND section.
+	(_bfd_elf_init_private_section_data): Copy sh_info from input
+	for GNU_MBIND section.
+
+2017-04-03  Palmer Dabbelt  <palmer@dabbelt.com>
+
+	* elfnn-riscv.c (GP_NAME): Delete.
+	(riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
+	(_bfd_riscv_relax_lui): Likewise.
+
+2017-04-04  Nick Clifton  <nickc@redhat.com>
+
+	PR binutils/21342
+	* elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
+	dereference.
+	(bfd_elf_final_link): Only initialize the extended symbol index
+	section if there are extended symbol tables to list.
+
+2017-04-03  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
+	(BFD32_BACKENDS_CFILES): Add elf-properties.c.
+	* configure.ac (elf): Add elf-properties.lo.
+	* Makefile.in: Regenerated.
+	* configure: Likewise.
+	* elf-bfd.h (elf_property_kind): New.
+	(elf_property): Likewise.
+	(elf_property_list): Likewise.
+	(elf_properties): Likewise.
+	(_bfd_elf_parse_gnu_properties): Likewise.
+	(_bfd_elf_get_property): Likewise.
+	(_bfd_elf_link_setup_gnu_properties): Likewise.
+	(elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
+	and setup_gnu_properties.
+	(elf_obj_tdata): Add properties.
+	* elf-properties.c: New file.
+	* elf32-i386.c (elf_i386_parse_gnu_properties): New.
+	(elf_i386_merge_gnu_properties): Likewise.
+	(elf_backend_parse_gnu_properties): Likewise.
+	(elf_backend_merge_gnu_properties): Likewise.
+	* elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
+	(elf_x86_64_merge_gnu_properties): Likewise.
+	(elf_backend_parse_gnu_properties): Likewise.
+	(elf_backend_merge_gnu_properties): Likewise.
+	* elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
+	(elf_backend_parse_gnu_properties): Likewise.
+	(elf_backend_setup_gnu_properties): Likewise.
+	(elfNN_bed): Add elf_backend_parse_gnu_properties,
+	elf_backend_merge_gnu_properties and
+	elf_backend_setup_gnu_properties.
+
 2017-03-30  Pip Cet  <pipcet@gmail.com>
 
 	* elf32-wasm32.c: Add relocation code, two relocs.
diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index 49ab092..97b608c 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -321,6 +321,7 @@ BFD32_BACKENDS = \
 	elf-m10200.lo \
 	elf-m10300.lo \
 	elf-nacl.lo \
+	elf-properties.lo \
 	elf-strtab.lo \
 	elf-vxworks.lo \
 	elf.lo \
@@ -516,6 +517,7 @@ BFD32_BACKENDS_CFILES = \
 	elf-m10200.c \
 	elf-m10300.c \
 	elf-nacl.c \
+	elf-properties.c \
 	elf-strtab.c \
 	elf-vxworks.c \
 	elf.c \
diff --git a/bfd/Makefile.in b/bfd/Makefile.in
index fed5117..e48abaf 100644
--- a/bfd/Makefile.in
+++ b/bfd/Makefile.in
@@ -655,6 +655,7 @@ BFD32_BACKENDS = \
 	elf-m10200.lo \
 	elf-m10300.lo \
 	elf-nacl.lo \
+	elf-properties.lo \
 	elf-strtab.lo \
 	elf-vxworks.lo \
 	elf.lo \
@@ -850,6 +851,7 @@ BFD32_BACKENDS_CFILES = \
 	elf-m10200.c \
 	elf-m10300.c \
 	elf-nacl.c \
+	elf-properties.c \
 	elf-strtab.c \
 	elf-vxworks.c \
 	elf.c \
@@ -1471,6 +1473,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf-m10200.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf-m10300.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf-nacl.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf-properties.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf-strtab.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf-vxworks.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf.Plo@am__quote@
diff --git a/bfd/config.bfd b/bfd/config.bfd
index 1235c2c..b00958d 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -173,6 +173,7 @@ fido*)		 targ_archs=bfd_m68k_arch ;;
 hppa*)		 targ_archs=bfd_hppa_arch ;;
 i[3-7]86)	 targ_archs=bfd_i386_arch ;;
 i370)		 targ_archs=bfd_i370_arch ;;
+ia16)		 targ_archs=bfd_i386_arch ;;
 lm32)	         targ_archs=bfd_lm32_arch ;;
 m6811*|m68hc11*) targ_archs="bfd_m68hc11_arch bfd_m68hc12_arch bfd_m9s12x_arch bfd_m9s12xg_arch" ;;
 m6812*|m68hc12*) targ_archs="bfd_m68hc12_arch bfd_m68hc11_arch bfd_m9s12x_arch bfd_m9s12xg_arch" ;;
@@ -906,6 +907,11 @@ case "${targ}" in
     targ_selvecs="icoff_le_vec icoff_be_vec"
     ;;
 
+  ia16-*-elf)
+    targ_defvec=i386_elf32_vec
+    targ_selvecs="i386_msdos_vec i386_aout_vec"
+    ;;
+
   ip2k-*-elf)
     targ_defvec=ip2k_elf32_vec
     ;;
diff --git a/bfd/configure b/bfd/configure
index 7cae4ae..24e3e2f 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -14234,7 +14234,7 @@ selarchs="$f"
 # Target backend .o files.
 tb=
 
-elf="elf.lo elflink.lo elf-attrs.lo elf-strtab.lo
+elf="elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-properties.lo
      elf-eh-frame.lo dwarf1.lo dwarf2.lo"
 coffgen="coffgen.lo dwarf2.lo"
 coff="cofflink.lo $coffgen"
diff --git a/bfd/configure.ac b/bfd/configure.ac
index feb1231..e568847 100644
--- a/bfd/configure.ac
+++ b/bfd/configure.ac
@@ -365,7 +365,7 @@ selarchs="$f"
 # Target backend .o files.
 tb=
 
-elf="elf.lo elflink.lo elf-attrs.lo elf-strtab.lo
+elf="elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-properties.lo
      elf-eh-frame.lo dwarf1.lo dwarf2.lo"
 coffgen="coffgen.lo dwarf2.lo"
 coff="cofflink.lo $coffgen"
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 9e3d6f5..af377ee 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -766,6 +766,39 @@ typedef asection * (*elf_gc_mark_hook_fn)
   (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
    struct elf_link_hash_entry *, Elf_Internal_Sym *);
 
+enum elf_property_kind
+ {
+    /* A new property.  */
+    property_unknown = 0,
+    /* A property ignored by backend.  */
+    property_ignored,
+    /* A corrupt property reported by backend.  */
+    property_corrupt,
+    /* A property should be removed due to property merge.  */
+    property_remove,
+    /* A property which is a number.  */
+    property_number
+ };
+
+typedef struct elf_property
+{
+  unsigned int pr_type;
+  unsigned int pr_datasz;
+  union
+    {
+      /* For property_number, this is a number.  */
+      bfd_vma number;
+      /* Add a new one if elf_property_kind is updated.  */
+    } u;
+  enum elf_property_kind pr_kind;
+} elf_property;
+
+typedef struct elf_property_list
+{
+  struct elf_property_list *next;
+  struct elf_property property;
+} elf_property_list;
+
 struct bfd_elf_section_reloc_data;
 
 struct elf_backend_data
@@ -1389,6 +1422,19 @@ struct elf_backend_data
      or give an error and return FALSE.  */
   bfd_boolean (*obj_attrs_handle_unknown) (bfd *, int);
 
+  /* Parse GNU properties.  Return the property kind.  If the property
+     is corrupt, issue an error message and return property_corrupt.  */
+  enum elf_property_kind (*parse_gnu_properties) (bfd *, unsigned int,
+						  bfd_byte *,
+						  unsigned int);
+
+  /* Merge GNU properties.  Return TRUE if property is updated.  */
+  bfd_boolean (*merge_gnu_properties) (bfd *, elf_property *,
+				       elf_property *);
+
+  /* Set up GNU properties.  */
+  void (*setup_gnu_properties) (struct bfd_link_info *);
+
   /* Encoding used for compact EH tables.  */
   int (*compact_eh_encoding) (struct bfd_link_info *);
 
@@ -1798,6 +1844,10 @@ struct elf_obj_tdata
   /* Symbol buffer.  */
   void *symbuf;
 
+  /* List of GNU properties.  Will be updated by setup_gnu_properties
+     after all input GNU properties are merged for output.  */
+  elf_property_list *properties;
+
   obj_attribute known_obj_attributes[2][NUM_KNOWN_OBJ_ATTRIBUTES];
   obj_attribute_list *other_obj_attributes[2];
 
@@ -1882,6 +1932,7 @@ struct elf_obj_tdata
   (elf_known_obj_attributes (bfd) [OBJ_ATTR_PROC])
 #define elf_other_obj_attributes_proc(bfd) \
   (elf_other_obj_attributes (bfd) [OBJ_ATTR_PROC])
+#define elf_properties(bfd) (elf_tdata (bfd) -> properties)
 \f
 extern void _bfd_elf_swap_verdef_in
   (bfd *, const Elf_External_Verdef *, Elf_Internal_Verdef *);
@@ -2538,6 +2589,13 @@ extern bfd_boolean _bfd_elf_merge_unknown_attribute_low (bfd *, bfd *, int);
 extern bfd_boolean _bfd_elf_merge_unknown_attribute_list (bfd *, bfd *);
 extern Elf_Internal_Shdr *_bfd_elf_single_rel_hdr (asection *sec);
 
+extern bfd_boolean _bfd_elf_parse_gnu_properties
+  (bfd *, Elf_Internal_Note *);
+extern elf_property * _bfd_elf_get_property
+  (bfd *, unsigned int, unsigned int);
+extern void _bfd_elf_link_setup_gnu_properties
+  (struct bfd_link_info *);
+
 /* The linker may need to keep track of the number of relocs that it
    decides to copy as dynamic relocs in check_relocs for each symbol.
    This is so that it can later discard them if they are found to be
diff --git a/bfd/elf-properties.c b/bfd/elf-properties.c
new file mode 100644
index 0000000..a0456f8
--- /dev/null
+++ b/bfd/elf-properties.c
@@ -0,0 +1,483 @@
+/* ELF program property support.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+
+   This file is part of BFD, the Binary File Descriptor library.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+/* GNU program property draft is at:
+
+   https://github.com/hjl-tools/linux-abi/wiki/property-draft.pdf
+ */
+
+#include "sysdep.h"
+#include "bfd.h"
+#include "libbfd.h"
+#include "elf-bfd.h"
+
+/* Get a property, allocate a new one if needed.  */
+
+elf_property *
+_bfd_elf_get_property (bfd *abfd, unsigned int type, unsigned int datasz)
+{
+  elf_property_list *p, **lastp;
+
+  if (bfd_get_flavour (abfd) != bfd_target_elf_flavour)
+    {
+      /* Never should happen.  */
+      abort ();
+    }
+
+  /* Keep the property list in order of type.  */
+  lastp = &elf_properties (abfd);
+  for (p = *lastp; p; p = p->next)
+    {
+      /* Reuse the existing entry.  */
+      if (type == p->property.pr_type)
+	{
+	  if (datasz > p->property.pr_datasz)
+	    {
+	      /* This can happen when mixing 32-bit and 64-bit objects.  */
+	      p->property.pr_datasz = datasz;
+	    }
+	  return &p->property;
+	}
+      else if (type < p->property.pr_type)
+	break;
+      lastp = &p->next;
+    }
+  p = (elf_property_list *) bfd_alloc (abfd, sizeof (*p));
+  if (p == NULL)
+    {
+      _bfd_error_handler (_("%B: out of memory in _bfd_elf_get_property"),
+			  abfd);
+      _exit (EXIT_FAILURE);
+    }
+  memset (p, 0, sizeof (*p));
+  p->property.pr_type = type;
+  p->property.pr_datasz = datasz;
+  p->next = *lastp;
+  *lastp = p;
+  return &p->property;
+}
+
+/* Parse GNU properties.  */
+
+bfd_boolean
+_bfd_elf_parse_gnu_properties (bfd *abfd, Elf_Internal_Note *note)
+{
+  const struct elf_backend_data *bed = get_elf_backend_data (abfd);
+  unsigned int align_size = bed->s->elfclass == ELFCLASS64 ? 8 : 4;
+  bfd_byte *ptr = (bfd_byte *) note->descdata;
+  bfd_byte *ptr_end = ptr + note->descsz;
+
+  if (note->descsz < 8 || (note->descsz % align_size) != 0)
+    {
+bad_size:
+      _bfd_error_handler
+	(_("warning: %B: corrupt GNU_PROPERTY_TYPE (%ld) size: %#lx\n"),
+	 abfd, note->type, note->descsz);
+      return FALSE;
+    }
+
+  while (1)
+    {
+      unsigned int type = bfd_h_get_32 (abfd, ptr);
+      unsigned int datasz = bfd_h_get_32 (abfd, ptr + 4);
+      elf_property *prop;
+
+      ptr += 8;
+
+      if ((ptr + datasz) > ptr_end)
+	{
+	  _bfd_error_handler
+	    (_("warning: %B: corrupt GNU_PROPERTY_TYPE (%ld) type (0x%x) datasz: 0x%x\n"),
+	     abfd, note->type, type, datasz);
+	  /* Clear all properties.  */
+	  elf_properties (abfd) = NULL;
+	  return FALSE;
+	}
+
+      if (type >= GNU_PROPERTY_LOPROC)
+	{
+	  if (type < GNU_PROPERTY_LOUSER && bed->parse_gnu_properties)
+	    {
+	      enum elf_property_kind kind
+		= bed->parse_gnu_properties (abfd, type, ptr, datasz);
+	      if (kind == property_corrupt)
+		{
+		  /* Clear all properties.  */
+		  elf_properties (abfd) = NULL;
+		  return FALSE;
+		}
+	      else if (kind != property_ignored)
+		goto next;
+	    }
+	}
+      else
+	{
+	  switch (type)
+	    {
+	    case GNU_PROPERTY_STACK_SIZE:
+	      if (datasz != align_size)
+		{
+		  _bfd_error_handler
+		    (_("warning: %B: corrupt stack size: 0x%x\n"),
+		     abfd, datasz);
+		  /* Clear all properties.  */
+		  elf_properties (abfd) = NULL;
+		  return FALSE;
+		}
+	      prop = _bfd_elf_get_property (abfd, type, datasz);
+	      if (datasz == 8)
+		prop->u.number = bfd_h_get_64 (abfd, ptr);
+	      else
+		prop->u.number = bfd_h_get_32 (abfd, ptr);
+	      prop->pr_kind = property_number;
+	      goto next;
+
+	    case GNU_PROPERTY_NO_COPY_ON_PROTECTED:
+	      if (datasz != 0)
+		{
+		  _bfd_error_handler
+		    (_("warning: %B: corrupt no copy on protected size: 0x%x\n"),
+		     abfd, datasz);
+		  /* Clear all properties.  */
+		  elf_properties (abfd) = NULL;
+		  return FALSE;
+		}
+	      prop = _bfd_elf_get_property (abfd, type, datasz);
+	      prop->pr_kind = property_number;
+	      goto next;
+
+	    default:
+	      break;
+	    }
+	}
+
+      _bfd_error_handler
+	(_("warning: %B: unsupported GNU_PROPERTY_TYPE (%ld) type: 0x%x\n"),
+	 abfd, note->type, type);
+
+next:
+      ptr += (datasz + (align_size - 1)) & ~ (align_size - 1);
+      if (ptr == ptr_end)
+	break;
+
+      if (ptr > (ptr_end - 8))
+	goto bad_size;
+    }
+
+  return TRUE;
+}
+
+/* Merge GNU property BPROP with APROP.  If APROP isn't NULL, return TRUE
+   if APROP is updated.  Otherwise, return TRUE if BPROP should be merged
+   with ABFD.  */
+
+static bfd_boolean
+elf_merge_gnu_properties (bfd *abfd, elf_property *aprop,
+			  elf_property *bprop)
+{
+  const struct elf_backend_data *bed = get_elf_backend_data (abfd);
+  unsigned int pr_type = aprop != NULL ? aprop->pr_type : bprop->pr_type;
+
+  if (bed->merge_gnu_properties != NULL
+      && pr_type >= GNU_PROPERTY_LOPROC
+      && pr_type < GNU_PROPERTY_LOUSER)
+    return bed->merge_gnu_properties (abfd, aprop, bprop);
+
+  switch (pr_type)


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [SCM]  users/jkratoch/indexcxx-debugnames: Merge branch 'indexcxx' into indexcxx-debugnames
@ 2017-04-02 11:01 jkratoch
  0 siblings, 0 replies; 2+ messages in thread
From: jkratoch @ 2017-04-02 11:01 UTC (permalink / raw)
  To: archer-commits

The branch, users/jkratoch/indexcxx-debugnames has been updated
       via  e7fd7db7d4406e5ebb9e4fe05bb38b2202cd8f98 (commit)
       via  590d37ae8d079e541cf184782899ef84b2b3f569 (commit)
       via  0578e350c8b26b319ad81d9960a470e539a410b8 (commit)
       via  e3dd10552e7c9e09bb49edc72f141aeefcf72bf3 (commit)
       via  fecb9c46659c576e9e2c790eff2a25df8203a97f (commit)
       via  858f82bf7e6531f4ad821285359c759c835f9dce (commit)
       via  8fa5b777488105287e56937365523d01e51c2eb3 (commit)
       via  efdf7a02db60e7371ba6372e47b510aadecbae28 (commit)
       via  dc1e4d6dedcb8ee3bb195f0db711f6aa164b8ab4 (commit)
       via  938ec663b8ec03336bd0387ee8f8d6f18f199025 (commit)
       via  f96bd6c2d7a3801fabbf9d834f7a29b752aa7532 (commit)
       via  662659a1a582af14aa45a458005e2a4df514b6d7 (commit)
       via  a62b75569b0e8038cf7c61350bf6fd5d0d6b64f8 (commit)
       via  75446032a9924dc28369d451b23d570534a836f7 (commit)
       via  72626a106545009c1054d6fdf7625fcc3e9b3dff (commit)
       via  ec13808ef07550f8a5f87fad1945739da1f10c81 (commit)
       via  f7c514a3784384215692c43d66f013d7640db277 (commit)
       via  1231656410996d2cc271486adc743a0fafe2ab4d (commit)
       via  52be03fd13a26ecda4f27c451a434f19eded0ca6 (commit)
       via  e643cb45bf85fa5c8c49a89ff177de246af4212e (commit)
       via  7cc0cd2903612a0730de6ba00181b9016e77ea3d (commit)
       via  086554e8e6b222518f12acab34e6cc7b5af7fde7 (commit)
       via  fe5f7374bef8f23ffa0fe0dee0f9b05e0a218a29 (commit)
       via  eea787570f708e51048f812808e6cbd76fde6919 (commit)
       via  3be78afdeddd3ebf57eb0df8b029cf596f468c7a (commit)
       via  296ec4fa2afb14abc400fa0109d7288eb958c544 (commit)
       via  081c108e3688d67f257d4b98c9012ef2677b3b18 (commit)
       via  a12e714b775ce025444af15dcfbd5a420363ad53 (commit)
       via  f74f865e5030057deb8a6a56af4a9e003d82cdcd (commit)
       via  0d0bf81a6729478563c3851ccfca435222ddfa25 (commit)
       via  1a09b50a463ad005946849540da136b5cbe6237b (commit)
       via  0ce4291e3ffd90d2b94e02b4557d716c043bf02e (commit)
       via  c56054f9a80e157e3d2d5109821abd191b68f0ea (commit)
       via  a43986283d61ffd4d7dc9b20c0ecb73cd345206c (commit)
       via  8c43009f48a0d4be497cf7c1285784aa70fc5abd (commit)
       via  a7e80b9e21eb907ac5c90de7452588c059db0cec (commit)
       via  b1a42fdfa31937d7e05df34afee970ac0ad239e1 (commit)
       via  a6be053897be3786ceda9a59d17befe11454f6d2 (commit)
       via  210477268d4ac5cad937e811888a5c932206794c (commit)
       via  9b7539374617a94c2d646f49e1bbfc954b11891d (commit)
       via  d721ba37d8995b9c11a0b8eef0f4d2dc022f85aa (commit)
       via  79b1d3cb362385c38af9cfb44c0c87b939711fbc (commit)
       via  8fb740dd3032543b833b141011aa2005c035d024 (commit)
       via  c0c31e91adc6aabe7c96f02dd51a0f6200a982da (commit)
       via  cf31b44f3c4d839db0dcce10e0c4cc47d3be4ff1 (commit)
       via  f124168208a5927e9f1b9843094ec2bf2aad2edf (commit)
       via  7ed687b257a4182771079c582887498d0a98810c (commit)
       via  275c67ffb452f21f5c002cd0c7bbfd244848111d (commit)
       via  ed771251e16c8c66cbdd03738135e76caef6937e (commit)
       via  568c1b9f503649d19ed1d17e6970f212e6b6317d (commit)
       via  62785b09987359ede74a98fac11343827f7181af (commit)
       via  c72cea5aec39df2d7a105755691a61460ee64f59 (commit)
       via  cad1105d6a28e1199e82653619fbd63c2b9d4fa6 (commit)
       via  3e00d44febb8093d8dc0e6842b975afb194c4fd1 (commit)
       via  077ae656a69fcf144f68848a3f6f2cb559b62987 (commit)
       via  1e2b521d987a34898ca959a33972be8912511ba0 (commit)
       via  338771252e913f82df8a445cb3e748a791b1cba8 (commit)
       via  a0eef9404b0fcfc8b0fbe7511d094a419ac631e9 (commit)
       via  1a5e158b68d0fb3b1ba3d038e87c841239572a35 (commit)
       via  3f2a3564b1c3872e4a380f2484d40ce2495a4835 (commit)
       via  ad36c6ce7c176a0bade3b3f09b801e65ab5ef93f (commit)
       via  19683c0408d66d9e48085fd5af009ad7d83aa3cd (commit)
      from  f0bbec61561e852f0be9682b5ad11fcac3143dd1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit e7fd7db7d4406e5ebb9e4fe05bb38b2202cd8f98
Merge: 0578e35 590d37a
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sun Apr 2 13:01:26 2017 +0200

    Merge branch 'indexcxx' into indexcxx-debugnames

commit 0578e350c8b26b319ad81d9960a470e539a410b8
Merge: 7544603 e3dd105
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Mar 31 19:06:39 2017 +0200

    Merge branch 'indexcxx' into indexcxx-debugnames

commit 75446032a9924dc28369d451b23d570534a836f7
Merge: f0bbec6 72626a1
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Mar 29 22:52:00 2017 +0200

    Merge branch 'indexcxx' into indexcxx-debugnames

-----------------------------------------------------------------------

Summary of changes:
 bfd/ChangeLog                                      |   54 +
 bfd/Makefile.am                                    |    6 +
 bfd/Makefile.in                                    |    9 +
 bfd/archures.c                                     |    4 +
 bfd/bfd-in2.h                                      |   14 +
 bfd/coff-bfd.h                                     |    2 +
 bfd/coffgen.c                                      |   40 +-
 bfd/config.bfd                                     |    6 +
 bfd/configure                                      |    2 +
 bfd/configure.ac                                   |    2 +
 bfd/cpu-wasm32.c                                   |   36 +
 bfd/doc/webassembly.texi                           |   33 +
 bfd/dwarf2.c                                       |   20 +-
 bfd/elf32-cris.c                                   |    9 +-
 bfd/elf32-wasm32.c                                 |  155 +
 bfd/libbfd.h                                       |   10 +
 bfd/po/SRC-POTFILES.in                             |    3 +
 bfd/po/bfd.pot                                     | 1348 ++++----
 bfd/reloc.c                                        |   23 +
 bfd/targets.c                                      |    5 +
 bfd/version.h                                      |    2 +-
 bfd/wasm-module.c                                  |  839 +++++
 bfd/wasm-module.h                                  |   52 +
 binutils/ChangeLog                                 |   38 +
 binutils/NEWS                                      |    2 +
 binutils/doc/binutils.texi                         |   34 +-
 binutils/readelf.c                                 |    9 +
 binutils/testsuite/binutils-all/nm.exp             |    3 +-
 .../testsuite/binutils-all/wasm32/create-wasm.d    |   10 +
 .../testsuite/binutils-all/wasm32/create-wasm.s    |    6 +
 .../testsuite/binutils-all/wasm32/custom-section.d |   11 +
 .../testsuite/binutils-all/wasm32/custom-section.s |    4 +
 .../testsuite/binutils-all/wasm32/invalid-wasm-1.d |    6 +
 .../testsuite/binutils-all/wasm32/invalid-wasm-1.s |    7 +
 .../testsuite/binutils-all/wasm32/invalid-wasm-2.d |    6 +
 .../testsuite/binutils-all/wasm32/invalid-wasm-2.s |    7 +
 .../testsuite/binutils-all/wasm32/long-sections.d  |   13 +
 .../testsuite/binutils-all/wasm32/long-sections.s  |    9 +
 .../testsuite/binutils-all/wasm32/parse-wasm-2.d   |   15 +
 .../testsuite/binutils-all/wasm32/parse-wasm-2.s   |   43 +
 .../testsuite/binutils-all/wasm32/parse-wasm.d     |    8 +
 .../testsuite/binutils-all/wasm32/parse-wasm.s     |    7 +
 .../binutils-all/wasm32/prepared-section.d         |   10 +
 .../binutils-all/wasm32/prepared-section.s         |    6 +
 binutils/testsuite/binutils-all/wasm32/wasm32.exp  |   29 +
 binutils/testsuite/lib/binutils-common.exp         |    4 +
 gas/ChangeLog                                      |  110 +
 gas/Makefile.am                                    |    2 +
 gas/Makefile.in                                    |   17 +
 gas/NEWS                                           |    2 +
 gas/config/tc-arm.c                                |    4 +-
 gas/config/tc-ppc.c                                |    3 +-
 gas/config/tc-riscv.c                              |   24 +-
 gas/config/tc-s390.c                               |    6 +-
 gas/config/tc-wasm32.c                             |  821 +++++
 gas/config/tc-wasm32.h                             |   89 +
 gas/configure.tgt                                  |    3 +
 gas/doc/all.texi                                   |    1 +
 gas/doc/as.texinfo                                 |    9 +-
 gas/doc/c-riscv.texi                               |    8 +
 gas/doc/c-wasm32.texi                              |  119 +
 gas/po/POTFILES.in                                 |    2 +
 gas/po/gas.pot                                     | 3486 ++++++++++----------
 gas/testsuite/gas/arc/nps400-12.d                  |   59 +
 gas/testsuite/gas/arc/nps400-12.s                  |   71 +
 gas/testsuite/gas/ppc/ppc.exp                      |    1 +
 gas/testsuite/gas/ppc/pr21303.d                    |   12 +
 gas/testsuite/gas/ppc/pr21303.s                    |    5 +
 gas/testsuite/gas/wasm32/allinsn.d                 |  198 ++
 gas/testsuite/gas/wasm32/allinsn.s                 |  171 +
 gas/testsuite/gas/wasm32/illegal-10.l              |    3 +
 gas/testsuite/gas/wasm32/illegal-10.s              |    1 +
 gas/testsuite/gas/wasm32/illegal-11.l              |    3 +
 gas/testsuite/gas/wasm32/illegal-11.s              |    1 +
 gas/testsuite/gas/wasm32/illegal-12.l              |    3 +
 gas/testsuite/gas/wasm32/illegal-12.s              |    1 +
 gas/testsuite/gas/wasm32/illegal-13.l              |    3 +
 gas/testsuite/gas/wasm32/illegal-13.s              |    1 +
 gas/testsuite/gas/wasm32/illegal-14.l              |    3 +
 gas/testsuite/gas/wasm32/illegal-14.s              |    1 +
 gas/testsuite/gas/wasm32/illegal-15.l              |    3 +
 gas/testsuite/gas/wasm32/illegal-15.s              |    1 +
 gas/testsuite/gas/wasm32/illegal-16.l              |    3 +
 gas/testsuite/gas/wasm32/illegal-16.s              |    1 +
 gas/testsuite/gas/wasm32/illegal-17.l              |    3 +
 gas/testsuite/gas/wasm32/illegal-17.s              |    1 +
 gas/testsuite/gas/wasm32/illegal-18.l              |    3 +
 gas/testsuite/gas/wasm32/illegal-18.s              |    1 +
 gas/testsuite/gas/wasm32/illegal-19.l              |    3 +
 gas/testsuite/gas/wasm32/illegal-19.s              |    1 +
 gas/testsuite/gas/wasm32/illegal-2.l               |    3 +
 gas/testsuite/gas/wasm32/illegal-2.s               |    1 +
 gas/testsuite/gas/wasm32/illegal-20.l              |    3 +
 gas/testsuite/gas/wasm32/illegal-20.s              |    1 +
 gas/testsuite/gas/wasm32/illegal-21.l              |    3 +
 gas/testsuite/gas/wasm32/illegal-21.s              |    1 +
 gas/testsuite/gas/wasm32/illegal-22.l              |    3 +
 gas/testsuite/gas/wasm32/illegal-24.l              |    3 +
 gas/testsuite/gas/wasm32/illegal-24.s              |    1 +
 gas/testsuite/gas/wasm32/illegal-25.l              |    3 +
 gas/testsuite/gas/wasm32/illegal-25.s              |    1 +
 gas/testsuite/gas/wasm32/illegal-3.l               |    3 +
 gas/testsuite/gas/wasm32/illegal-3.s               |    1 +
 gas/testsuite/gas/wasm32/illegal-4.l               |    3 +
 gas/testsuite/gas/wasm32/illegal-4.s               |    1 +
 gas/testsuite/gas/wasm32/illegal-5.l               |    3 +
 gas/testsuite/gas/wasm32/illegal-5.s               |    1 +
 gas/testsuite/gas/wasm32/illegal-6.l               |    3 +
 gas/testsuite/gas/wasm32/illegal-6.s               |    1 +
 gas/testsuite/gas/wasm32/illegal-7.l               |    3 +
 gas/testsuite/gas/wasm32/illegal-7.s               |    1 +
 gas/testsuite/gas/wasm32/illegal-8.l               |    3 +
 gas/testsuite/gas/wasm32/illegal-8.s               |    1 +
 gas/testsuite/gas/wasm32/illegal-9.l               |    3 +
 gas/testsuite/gas/wasm32/illegal-9.s               |    1 +
 gas/testsuite/gas/wasm32/illegal.l                 |    3 +
 gas/testsuite/gas/wasm32/illegal.s                 |    1 +
 gas/testsuite/gas/wasm32/reloc.d                   |   18 +
 gas/testsuite/gas/wasm32/reloc.s                   |    3 +
 gas/testsuite/gas/wasm32/wasm32.exp                |   58 +
 gdb/ChangeLog                                      |  202 ++
 gdb/NEWS                                           |    3 +
 gdb/aarch64-tdep.c                                 |   75 +-
 gdb/arc-tdep.c                                     |  852 +++++-
 gdb/arc-tdep.h                                     |   41 +
 gdb/arch/xtensa.h                                  |    2 +
 gdb/auto-load.c                                    |    3 +-
 gdb/common/common-defs.h                           |   14 +
 gdb/cp-name-parser.y                               |   60 +-
 gdb/d-exp.y                                        |    1 +
 gdb/doc/ChangeLog                                  |    8 +
 gdb/doc/gdb.texinfo                                |    7 +-
 gdb/dwarf2read.c                                   |  492 ++--
 gdb/fbsd-tdep.c                                    |    4 -
 gdb/gdbserver/.gitignore                           |   18 +-
 gdb/gdbserver/ChangeLog                            |   27 +
 gdb/gdbserver/Makefile.in                          |   68 +-
 gdb/gdbserver/linux-xtensa-low.c                   |   39 +
 gdb/gdbthread.h                                    |   54 +-
 gdb/proc-service.c                                 |   36 +-
 gdb/python/python.c                                |    2 +-
 gdb/regcache.c                                     |   52 +-
 gdb/regcache.h                                     |    6 +
 gdb/sol-thread.c                                   |   57 +-
 gdb/solib-target.c                                 |    2 +-
 gdb/target.c                                       |   46 +-
 gdb/testsuite/ChangeLog                            |   14 +
 gdb/testsuite/gdb.arch/arc-analyze-prologue.S      |  903 +++++
 gdb/testsuite/gdb.arch/arc-analyze-prologue.exp    |  201 ++
 gdb/testsuite/gdb.arch/arc-decode-insn.S           | 1002 ++++++
 gdb/testsuite/gdb.arch/arc-decode-insn.exp         |  132 +
 gdb/testsuite/gdb.dlang/watch-loc.c                |   36 +
 gdb/testsuite/gdb.dlang/watch-loc.exp              |   83 +
 gdb/testsuite/gdb.python/py-section-script.exp     |   38 +
 gdb/thread.c                                       |   69 +-
 gdb/utils.c                                        |   10 +-
 gdb/utils.h                                        |    2 +-
 gdb/xml-support.h                                  |    4 +-
 gdb/xml-syscall.c                                  |    8 +-
 gdb/xml-tdesc.c                                    |   12 +-
 gdb/xtensa-linux-nat.c                             |   36 +
 gdb/xtensa-tdep.c                                  |   15 +-
 gdb/xtensa-tdep.h                                  |    1 +
 include/ChangeLog                                  |   61 +
 include/elf/wasm32.h                               |   30 +
 include/opcode/arc.h                               |   14 +-
 include/opcode/ppc.h                               |   80 +-
 include/opcode/riscv-opc.h                         |   40 +
 include/opcode/wasm.h                              |  226 ++
 ld/ChangeLog                                       |    9 +-
 ld/testsuite/ld-cris/dso-1c.s                      |    2 +
 ld/testsuite/ld-cris/dso-2b.s                      |    2 +
 ld/testsuite/ld-cris/dso-4.s                       |    6 +
 ld/testsuite/ld-cris/pr16044.d                     |   43 +
 libiberty/ChangeLog                                |    5 +
 libiberty/cp-demint.c                              |    1 +
 opcodes/ChangeLog                                  |   37 +
 opcodes/arc-nps400-tbl.h                           |   72 +
 opcodes/arc-opc.c                                  |  880 +++--
 opcodes/configure                                  |    1 +
 opcodes/configure.ac                               |    1 +
 opcodes/po/opcodes.pot                             |  339 +-
 opcodes/ppc-dis.c                                  |   42 +-
 opcodes/sparc-opc.c                                |   28 +
 sim/aarch64/ChangeLog                              |    5 +
 sim/aarch64/simulator.c                            |    2 +-
 sim/testsuite/sim/aarch64/ChangeLog                |    4 +
 sim/testsuite/sim/aarch64/adds.s                   |   17 +
 188 files changed, 11528 insertions(+), 3514 deletions(-)
 create mode 100644 bfd/cpu-wasm32.c
 create mode 100644 bfd/doc/webassembly.texi
 create mode 100644 bfd/elf32-wasm32.c
 create mode 100644 bfd/wasm-module.c
 create mode 100644 bfd/wasm-module.h
 create mode 100644 binutils/testsuite/binutils-all/wasm32/create-wasm.d
 create mode 100644 binutils/testsuite/binutils-all/wasm32/create-wasm.s
 create mode 100644 binutils/testsuite/binutils-all/wasm32/custom-section.d
 create mode 100644 binutils/testsuite/binutils-all/wasm32/custom-section.s
 create mode 100644 binutils/testsuite/binutils-all/wasm32/invalid-wasm-1.d
 create mode 100644 binutils/testsuite/binutils-all/wasm32/invalid-wasm-1.s
 create mode 100644 binutils/testsuite/binutils-all/wasm32/invalid-wasm-2.d
 create mode 100644 binutils/testsuite/binutils-all/wasm32/invalid-wasm-2.s
 create mode 100644 binutils/testsuite/binutils-all/wasm32/long-sections.d
 create mode 100644 binutils/testsuite/binutils-all/wasm32/long-sections.s
 create mode 100644 binutils/testsuite/binutils-all/wasm32/parse-wasm-2.d
 create mode 100644 binutils/testsuite/binutils-all/wasm32/parse-wasm-2.s
 create mode 100644 binutils/testsuite/binutils-all/wasm32/parse-wasm.d
 create mode 100644 binutils/testsuite/binutils-all/wasm32/parse-wasm.s
 create mode 100644 binutils/testsuite/binutils-all/wasm32/prepared-section.d
 create mode 100644 binutils/testsuite/binutils-all/wasm32/prepared-section.s
 create mode 100644 binutils/testsuite/binutils-all/wasm32/wasm32.exp
 create mode 100644 gas/config/tc-wasm32.c
 create mode 100644 gas/config/tc-wasm32.h
 create mode 100644 gas/doc/c-wasm32.texi
 create mode 100644 gas/testsuite/gas/arc/nps400-12.d
 create mode 100644 gas/testsuite/gas/arc/nps400-12.s
 create mode 100644 gas/testsuite/gas/ppc/pr21303.d
 create mode 100644 gas/testsuite/gas/ppc/pr21303.s
 create mode 100644 gas/testsuite/gas/wasm32/allinsn.d
 create mode 100644 gas/testsuite/gas/wasm32/allinsn.s
 create mode 100644 gas/testsuite/gas/wasm32/illegal-10.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal-10.s
 create mode 100644 gas/testsuite/gas/wasm32/illegal-11.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal-11.s
 create mode 100644 gas/testsuite/gas/wasm32/illegal-12.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal-12.s
 create mode 100644 gas/testsuite/gas/wasm32/illegal-13.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal-13.s
 create mode 100644 gas/testsuite/gas/wasm32/illegal-14.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal-14.s
 create mode 100644 gas/testsuite/gas/wasm32/illegal-15.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal-15.s
 create mode 100644 gas/testsuite/gas/wasm32/illegal-16.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal-16.s
 create mode 100644 gas/testsuite/gas/wasm32/illegal-17.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal-17.s
 create mode 100644 gas/testsuite/gas/wasm32/illegal-18.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal-18.s
 create mode 100644 gas/testsuite/gas/wasm32/illegal-19.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal-19.s
 create mode 100644 gas/testsuite/gas/wasm32/illegal-2.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal-2.s
 create mode 100644 gas/testsuite/gas/wasm32/illegal-20.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal-20.s
 create mode 100644 gas/testsuite/gas/wasm32/illegal-21.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal-21.s
 create mode 100644 gas/testsuite/gas/wasm32/illegal-22.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal-24.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal-24.s
 create mode 100644 gas/testsuite/gas/wasm32/illegal-25.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal-25.s
 create mode 100644 gas/testsuite/gas/wasm32/illegal-3.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal-3.s
 create mode 100644 gas/testsuite/gas/wasm32/illegal-4.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal-4.s
 create mode 100644 gas/testsuite/gas/wasm32/illegal-5.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal-5.s
 create mode 100644 gas/testsuite/gas/wasm32/illegal-6.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal-6.s
 create mode 100644 gas/testsuite/gas/wasm32/illegal-7.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal-7.s
 create mode 100644 gas/testsuite/gas/wasm32/illegal-8.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal-8.s
 create mode 100644 gas/testsuite/gas/wasm32/illegal-9.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal-9.s
 create mode 100644 gas/testsuite/gas/wasm32/illegal.l
 create mode 100644 gas/testsuite/gas/wasm32/illegal.s
 create mode 100644 gas/testsuite/gas/wasm32/reloc.d
 create mode 100644 gas/testsuite/gas/wasm32/reloc.s
 create mode 100644 gas/testsuite/gas/wasm32/wasm32.exp
 create mode 100644 gdb/testsuite/gdb.arch/arc-analyze-prologue.S
 create mode 100644 gdb/testsuite/gdb.arch/arc-analyze-prologue.exp
 create mode 100644 gdb/testsuite/gdb.arch/arc-decode-insn.S
 create mode 100644 gdb/testsuite/gdb.arch/arc-decode-insn.exp
 create mode 100644 gdb/testsuite/gdb.dlang/watch-loc.c
 create mode 100644 gdb/testsuite/gdb.dlang/watch-loc.exp
 create mode 100644 include/elf/wasm32.h
 create mode 100644 include/opcode/wasm.h
 create mode 100644 ld/testsuite/ld-cris/dso-1c.s
 create mode 100644 ld/testsuite/ld-cris/dso-2b.s
 create mode 100644 ld/testsuite/ld-cris/dso-4.s
 create mode 100644 ld/testsuite/ld-cris/pr16044.d

First 500 lines of diff:
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 50e76c2..bb851c7 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,57 @@
+2017-03-30  Pip Cet  <pipcet@gmail.com>
+
+	* elf32-wasm32.c: Add relocation code, two relocs.
+	* reloc.c: Add wasm32 relocations.
+	* libbfd.h: Regenerate.
+	* bfd-in2.h: Regenerate.
+	* bfd/po/bfd.pot: Regenerate.
+
+2017-03-29  Nick Clifton  <nickc@redhat.com>
+
+	PR binutils/18025
+	* coff-bfd.h (struct coff_section_data): Add new fields:
+	saved_bias and bias.
+	* coffgen.c (coff_find_nearest_line_with_names): Cache the bias
+	computed for PE binaries.
+	* dwarf2.c (scan_unit_for_symbols): Only warn once about each
+	missing abbrev.
+
+2017-03-28  Hans-Peter Nilsson  <hp@axis.com>
+
+	PR ld/16044
+	* elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
+	to handle a local symbol with a hash-symbol-entry; without PLT.
+	Add BFD_ASSERT for an incidental case with GOT entry present.
+	(cris_elf_check_relocs): Increment PLT refcount only if the symbol
+	isn't forced-or-set local.
+
+2017-03-27  Pip Cet  <pipcet@gmail.com>
+
+	* wasm-module.c: New file to support WebAssembly modules.
+	* wasm-module.h: New file to support WebAssembly modules.
+	* doc/webassembly.texi: Start documenting wasm-module.c.
+	* config.bfd: Add wasm_vec.
+	* targets.c: Likewise.
+	* configure.ac: Likewise.
+	* Makefile.am: Add entries for wasm-module.c.
+	* Makefile.in: Regenerate.
+	* configure: Regenerate.
+	* po/SRC-POTFILES.in: Regenerate.
+
+2017-03-27  Pip Cet  <pipcet@gmail.com>
+
+	* cpu-wasm32.c: New file to support wasm32 architecture.
+	* elf32-wasm32.c: New file to support wasm32 architecture.
+	* Makefile.am: Add wasm32 architecture.
+	* archures.c: Likewise.
+	* config.bfd: Likewise.
+	* configure.ac: Likewise.
+	* targets.c: Likewise.
+	* Makefile.in: Regenerate.
+	* bfd-in2.h: Regenerate.
+	* configure: Regenerate.
+	* po/SRC-POTFILES.in: Regenerate.
+
 2017-03-20  Alan Modra  <amodra@gmail.com>
 
 	PR 21266
diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index 0b02263..49ab092 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -169,6 +169,7 @@ ALL_MACHINES = \
 	cpu-vax.lo \
 	cpu-visium.lo \
 	cpu-w65.lo \
+	cpu-wasm32.lo \
 	cpu-we32k.lo \
 	cpu-xc16x.lo \
 	cpu-xgate.lo \
@@ -257,6 +258,7 @@ ALL_MACHINES_CFILES = \
 	cpu-v850_rh850.c \
 	cpu-vax.c \
 	cpu-visium.c \
+	cpu-wasm32.c \
 	cpu-w65.c \
 	cpu-we32k.c \
 	cpu-xc16x.c \
@@ -383,6 +385,7 @@ BFD32_BACKENDS = \
 	elf32-v850.lo \
 	elf32-vax.lo \
 	elf32-visium.lo \
+	elf32-wasm32.lo \
 	elf32-xc16x.lo \
 	elf32-xgate.lo \
 	elf32-xstormy16.lo \
@@ -456,6 +459,7 @@ BFD32_BACKENDS = \
 	versados.lo \
 	vms-lib.lo \
 	vms-misc.lo \
+	wasm-module.lo \
 	xcofflink.lo \
 	xsym.lo \
 	xtensa-isa.lo \
@@ -576,6 +580,7 @@ BFD32_BACKENDS_CFILES = \
 	elf32-v850.c \
 	elf32-vax.c \
 	elf32-visium.c \
+	elf32-wasm32.c \
 	elf32-xc16x.c \
 	elf32-xgate.c \
 	elf32-xstormy16.c \
@@ -648,6 +653,7 @@ BFD32_BACKENDS_CFILES = \
 	versados.c \
 	vms-lib.c \
 	vms-misc.c \
+	wasm-module.c \
 	xcofflink.c \
 	xsym.c \
 	xtensa-isa.c \
diff --git a/bfd/Makefile.in b/bfd/Makefile.in
index 096c7ef..fed5117 100644
--- a/bfd/Makefile.in
+++ b/bfd/Makefile.in
@@ -502,6 +502,7 @@ ALL_MACHINES = \
 	cpu-vax.lo \
 	cpu-visium.lo \
 	cpu-w65.lo \
+	cpu-wasm32.lo \
 	cpu-we32k.lo \
 	cpu-xc16x.lo \
 	cpu-xgate.lo \
@@ -590,6 +591,7 @@ ALL_MACHINES_CFILES = \
 	cpu-v850_rh850.c \
 	cpu-vax.c \
 	cpu-visium.c \
+	cpu-wasm32.c \
 	cpu-w65.c \
 	cpu-we32k.c \
 	cpu-xc16x.c \
@@ -717,6 +719,7 @@ BFD32_BACKENDS = \
 	elf32-v850.lo \
 	elf32-vax.lo \
 	elf32-visium.lo \
+	elf32-wasm32.lo \
 	elf32-xc16x.lo \
 	elf32-xgate.lo \
 	elf32-xstormy16.lo \
@@ -790,6 +793,7 @@ BFD32_BACKENDS = \
 	versados.lo \
 	vms-lib.lo \
 	vms-misc.lo \
+	wasm-module.lo \
 	xcofflink.lo \
 	xsym.lo \
 	xtensa-isa.lo \
@@ -910,6 +914,7 @@ BFD32_BACKENDS_CFILES = \
 	elf32-v850.c \
 	elf32-vax.c \
 	elf32-visium.c \
+	elf32-wasm32.c \
 	elf32-xc16x.c \
 	elf32-xgate.c \
 	elf32-xstormy16.c \
@@ -982,6 +987,7 @@ BFD32_BACKENDS_CFILES = \
 	versados.c \
 	vms-lib.c \
 	vms-misc.c \
+	wasm-module.c \
 	xcofflink.c \
 	xsym.c \
 	xtensa-isa.c \
@@ -1446,6 +1452,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-vax.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-visium.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-w65.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-wasm32.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-we32k.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-xc16x.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-xgate.Plo@am__quote@
@@ -1534,6 +1541,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-v850.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-vax.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-visium.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-wasm32.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-xc16x.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-xgate.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-xstormy16.Plo@am__quote@
@@ -1665,6 +1673,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vms-alpha.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vms-lib.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vms-misc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wasm-module.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xcofflink.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xsym.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xtensa-isa.Plo@am__quote@
diff --git a/bfd/archures.c b/bfd/archures.c
index c909db0..c6e7152 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -528,6 +528,8 @@ DESCRIPTION
 .#define bfd_mach_nios2r2	2
 .  bfd_arch_visium,	{* Visium *}
 .#define bfd_mach_visium	1
+.  bfd_arch_wasm32,     {* WebAssembly *}
+.#define bfd_mach_wasm32        1
 .  bfd_arch_pru,	{* PRU *}
 .#define bfd_mach_pru	0
 .  bfd_arch_last
@@ -654,6 +656,7 @@ extern const bfd_arch_info_type bfd_v850_arch;
 extern const bfd_arch_info_type bfd_v850_rh850_arch;
 extern const bfd_arch_info_type bfd_vax_arch;
 extern const bfd_arch_info_type bfd_visium_arch;
+extern const bfd_arch_info_type bfd_wasm32_arch;
 extern const bfd_arch_info_type bfd_w65_arch;
 extern const bfd_arch_info_type bfd_we32k_arch;
 extern const bfd_arch_info_type bfd_xstormy16_arch;
@@ -746,6 +749,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] =
     &bfd_vax_arch,
     &bfd_visium_arch,
     &bfd_w65_arch,
+    &bfd_wasm32_arch,
     &bfd_we32k_arch,
     &bfd_xstormy16_arch,
     &bfd_xtensa_arch,
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 59403af..fbd379f 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -2372,6 +2372,8 @@ enum bfd_architecture
 #define bfd_mach_nios2r2       2
   bfd_arch_visium,     /* Visium */
 #define bfd_mach_visium        1
+  bfd_arch_wasm32,     /* WebAssembly */
+#define bfd_mach_wasm32        1
   bfd_arch_pru,        /* PRU */
 #define bfd_mach_pru   0
   bfd_arch_last
@@ -6462,6 +6464,18 @@ assembler and not (currently) written to any object files.  */
   BFD_RELOC_VISIUM_HI16_PCREL,
   BFD_RELOC_VISIUM_LO16_PCREL,
   BFD_RELOC_VISIUM_IM16_PCREL,
+
+/* WebAssembly relocations.  */
+  BFD_RELOC_WASM32_LEB128,
+  BFD_RELOC_WASM32_LEB128_GOT,
+  BFD_RELOC_WASM32_LEB128_GOT_CODE,
+  BFD_RELOC_WASM32_LEB128_PLT,
+  BFD_RELOC_WASM32_PLT_INDEX,
+  BFD_RELOC_WASM32_ABS32_CODE,
+  BFD_RELOC_WASM32_COPY,
+  BFD_RELOC_WASM32_CODE_POINTER,
+  BFD_RELOC_WASM32_INDEX,
+  BFD_RELOC_WASM32_PLT_SIG,
   BFD_RELOC_UNUSED };
 
 typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
diff --git a/bfd/coff-bfd.h b/bfd/coff-bfd.h
index c76bf3a..97117b3 100644
--- a/bfd/coff-bfd.h
+++ b/bfd/coff-bfd.h
@@ -50,6 +50,8 @@ struct coff_section_tdata
   /* If this is TRUE, the contents entry may not be freed.  */
   bfd_boolean keep_contents;
   /* Information cached by coff_find_nearest_line.  */
+  bfd_boolean saved_bias;
+  bfd_signed_vma bias;
   bfd_vma offset;
   unsigned int i;
   const char *function;
diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index 5a61f6d..3c60ed4 100644
--- a/bfd/coffgen.c
+++ b/bfd/coffgen.c
@@ -2259,6 +2259,8 @@ coff_find_nearest_line_with_names (bfd *abfd,
 				     &coff_data(abfd)->dwarf2_find_line_info))
     return TRUE;
 
+  sec_data = coff_section_data (abfd, section);
+
   /* If the DWARF lookup failed, but there is DWARF information available
      then the problem might be that the file has been rebased.  This tool
      changes the VMAs of all the sections, but it does not update the DWARF
@@ -2267,8 +2269,26 @@ coff_find_nearest_line_with_names (bfd *abfd,
     {
       bfd_signed_vma bias;
 
-      bias = _bfd_dwarf2_find_symbol_bias (symbols,
-					   & coff_data (abfd)->dwarf2_find_line_info);
+      /* Create a cache of the result for the next call.  */
+      if (sec_data == NULL && section->owner == abfd)
+	{
+	  amt = sizeof (struct coff_section_tdata);
+	  section->used_by_bfd = bfd_zalloc (abfd, amt);
+	  sec_data = (struct coff_section_tdata *) section->used_by_bfd;
+	}
+
+      if (sec_data != NULL && sec_data->saved_bias)
+	bias = sec_data->saved_bias;
+      else
+	{
+	  bias = _bfd_dwarf2_find_symbol_bias (symbols,
+					       & coff_data (abfd)->dwarf2_find_line_info);
+	  if (sec_data)
+	    {
+	      sec_data->saved_bias = TRUE;
+	      sec_data->bias = bias;
+	    }
+	}
 
       if (bias
 	  && _bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section,
@@ -2363,10 +2383,16 @@ coff_find_nearest_line_with_names (bfd *abfd,
 	}
     }
 
-  /* Now wander though the raw linenumbers of the section.  */
-  /* If we have been called on this section before, and the offset we
-     want is further down then we can prime the lookup loop.  */
-  sec_data = coff_section_data (abfd, section);
+  if (section->lineno_count == 0)
+    {
+      *functionname_ptr = NULL;
+      *line_ptr = 0;
+      return TRUE;
+    }
+
+  /* Now wander though the raw linenumbers of the section.
+     If we have been called on this section before, and the offset
+     we want is further down then we can prime the lookup loop.  */
   if (sec_data != NULL
       && sec_data->i > 0
       && offset >= sec_data->offset)
@@ -2395,6 +2421,7 @@ coff_find_nearest_line_with_names (bfd *abfd,
 	      coff_symbol_type *coff = (coff_symbol_type *) (l->u.sym);
 	      if (coff->symbol.value > offset)
 		break;
+
 	      *functionname_ptr = coff->symbol.name;
 	      last_value = coff->symbol.value;
 	      if (coff->native)
@@ -2451,6 +2478,7 @@ coff_find_nearest_line_with_names (bfd *abfd,
       section->used_by_bfd = bfd_zalloc (abfd, amt);
       sec_data = (struct coff_section_tdata *) section->used_by_bfd;
     }
+
   if (sec_data != NULL)
     {
       sec_data->offset = offset;
diff --git a/bfd/config.bfd b/bfd/config.bfd
index 52db9a4..1235c2c 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -197,6 +197,7 @@ tilegx*)	 targ_archs=bfd_tilegx_arch ;;
 tilepro*)	 targ_archs=bfd_tilepro_arch ;;
 v850*)		 targ_archs="bfd_v850_arch bfd_v850_rh850_arch" ;;
 visium*)	 targ_archs=bfd_visium_arch ;;
+wasm32)		 targ_archs=bfd_wasm32_arch ;;
 x86_64*)	 targ_archs=bfd_i386_arch ;;
 xtensa*)	 targ_archs=bfd_xtensa_arch ;;
 xgate)		 targ_archs=bfd_xgate_arch ;;
@@ -1793,6 +1794,11 @@ case "${targ}" in
     targ_defvec=visium_elf32_vec
     ;;
 
+  wasm32-*-*)
+    targ_defvec=wasm32_elf32_vec
+    targ_selvecs="wasm_vec"
+    ;;
+
   we32k-*-*)
     targ_defvec=we32k_coff_vec
     ;;
diff --git a/bfd/configure b/bfd/configure
index 83256d2..7cae4ae 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -14569,6 +14569,8 @@ do
     ft32_elf32_vec)		 tb="$tb elf32-ft32.lo elf32.lo $elf" ;;
     visium_elf32_vec)		 tb="$tb elf32-visium.lo elf32.lo $elf" ;;
     w65_coff_vec)		 tb="$tb coff-w65.lo reloc16.lo $coffgen" ;;
+    wasm_vec)                    tb="$tb wasm-module.lo" ;;
+    wasm32_elf32_vec)            tb="$tb elf32-wasm32.lo elf32.lo $elf" ;;
     we32k_coff_vec)		 tb="$tb coff-we32k.lo $coffgen" ;;
     x86_64_coff_vec)		 tb="$tb coff-x86_64.lo $coff"; target_size=64 ;;
     x86_64_elf32_vec)		 tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo elf32.lo $elf"; target_size=64 ;;
diff --git a/bfd/configure.ac b/bfd/configure.ac
index ee0c537..feb1231 100644
--- a/bfd/configure.ac
+++ b/bfd/configure.ac
@@ -700,6 +700,8 @@ do
     ft32_elf32_vec)		 tb="$tb elf32-ft32.lo elf32.lo $elf" ;;
     visium_elf32_vec)		 tb="$tb elf32-visium.lo elf32.lo $elf" ;;
     w65_coff_vec)		 tb="$tb coff-w65.lo reloc16.lo $coffgen" ;;
+    wasm_vec)                    tb="$tb wasm-module.lo" ;;
+    wasm32_elf32_vec)            tb="$tb elf32-wasm32.lo elf32.lo $elf" ;;
     we32k_coff_vec)		 tb="$tb coff-we32k.lo $coffgen" ;;
     x86_64_coff_vec)		 tb="$tb coff-x86_64.lo $coff"; target_size=64 ;;
     x86_64_elf32_vec)		 tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo elf32.lo $elf"; target_size=64 ;;
diff --git a/bfd/cpu-wasm32.c b/bfd/cpu-wasm32.c
new file mode 100644
index 0000000..19d4cb9
--- /dev/null
+++ b/bfd/cpu-wasm32.c
@@ -0,0 +1,36 @@
+/* BFD support for the WebAssembly target
+   Copyright (C) 2017 Free Software Foundation, Inc.
+
+   This file is part of BFD, the Binary File Descriptor library.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#include "sysdep.h"
+#include "bfd.h"
+#include "libbfd.h"
+#include "libiberty.h"
+
+#define N(number, print, default, next)  \
+{  32, 32, 8, bfd_arch_wasm32, number, "wasm32", "wasm32", 4, default, bfd_default_compatible, \
+   bfd_default_scan, bfd_arch_default_fill, next }
+
+static const bfd_arch_info_type arch_info_struct[] =
+{
+  N (bfd_mach_wasm32, "wasm32", TRUE, NULL)
+};
+
+const bfd_arch_info_type bfd_wasm32_arch =
+  N (bfd_mach_wasm32, "wasm32", TRUE, & arch_info_struct[0]);
diff --git a/bfd/doc/webassembly.texi b/bfd/doc/webassembly.texi
new file mode 100644
index 0000000..ad65094
--- /dev/null
+++ b/bfd/doc/webassembly.texi
@@ -0,0 +1,33 @@
+@section WebAssembly backend
+The WebAssembly module file format, at present, is a very simple
+object file format with up to 11 numbered sections plus named
+``custom'' sections. At present, there is no standard for relocations
+or symbols, though a @code{"name"} subsection can assign names to
+function indices and local variables.
+
+As such, it offers no real advantages over ELF, and intermediate ELF
+files can be used to produce WebAssembly modules. The WebAssembly
+backend aims to enable the opposite: reading a WebAssembly module and
+producing an ELF file containing the same information, which can then
+be manipulated and inspected with standard tools.
+
+When writing WebAssembly modules, the WebAssembly backend attempts to
+determine based on the section name whether to use a numeric section
+id, a named section header, or to include the section verbatim,
+assuming it already contains any necessary header.
+
+Function names are supported as symbols; local names and WebAssembly
+relocation sections are currently unsupported.
+
+There are slight differences in the LEB128 integer implementations
+between the WebAssembly specification and the BFD code; these result
+in some malformed WebAssembly modules being treated as valid.
+
+@menu
+* File layout::
+@end menu
+
+@node File layout, WebAssembly
+@subsection File layout
+For a description of the WebAssembly file format, see
+@url{https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md}.
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 722ee0d..132a674 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -2738,12 +2738,19 @@ scan_unit_for_symbols (struct comp_unit *unit)
 	  continue;
 	}
 
-      abbrev = lookup_abbrev (abbrev_number,unit->abbrevs);
+      abbrev = lookup_abbrev (abbrev_number, unit->abbrevs);
       if (! abbrev)
 	{
-	  _bfd_error_handler
-	    (_("Dwarf Error: Could not find abbrev number %u."),
-	     abbrev_number);
+	  static unsigned int previous_failed_abbrev = -1U;
+
+	  /* Avoid multiple reports of the same missing abbrev.  */
+	  if (abbrev_number != previous_failed_abbrev)
+	    {
+	      _bfd_error_handler
+		(_("Dwarf Error: Could not find abbrev number %u."),
+		 abbrev_number);
+	      previous_failed_abbrev = abbrev_number;
+	    }
 	  bfd_set_error (bfd_error_bad_value);


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-05 16:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-05 16:17 [SCM] users/jkratoch/indexcxx-debugnames: Merge branch 'indexcxx' into indexcxx-debugnames jkratoch
  -- strict thread matches above, loose matches on Subject: below --
2017-04-02 11:01 jkratoch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).