public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
From: kseitz@sourceware.org
To: archer-commits@sourceware.org
Subject: [SCM]  archer-keiths-linespec-rewrite: Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite
Date: Mon, 26 Mar 2012 21:41:00 -0000	[thread overview]
Message-ID: <20120326214130.4399.qmail@sourceware.org> (raw)

The branch, archer-keiths-linespec-rewrite has been updated
       via  e35c7e8e719cdaf8771b9b03b06be508c35f9949 (commit)
       via  79be8325606facdce0467e5e1b54b30513f8f727 (commit)
       via  b0e5cb87d66e1c74613ba923664bef9547b96172 (commit)
       via  a5cb0e3d12758e08a1ccc7f6f73529bc102a6d31 (commit)
       via  57feba1a12c978c57836cd9a78bace3aa68ff881 (commit)
       via  1ba1689e5d9a078016564b0f40729917563a9bb1 (commit)
       via  994022538d9a8c3f57f94f90b21f9796d54f6ea3 (commit)
       via  bb4f55dbcc7aa2bf1b0cdd439b7088d9ea7e9b00 (commit)
       via  3ef3d2e1c985426ccac17157185a962d20952624 (commit)
       via  c338d4bceb084a629b479e1ac36ab2b42737e1c2 (commit)
       via  a1c41c98de0b006bdad3a512be5d05be0ef9d8aa (commit)
       via  c6bbedcf2bdb97ade67f9dacd11d78152316d051 (commit)
       via  ecbf6e89d2155e3429a9cb9b30419a539565afe2 (commit)
       via  f4a023ee8a2015d98fd3aeb50a5ccde2f201ec46 (commit)
       via  68c4998cf419703473c5985f99aee1715c92d5e4 (commit)
       via  5e92d838c0cd75ff9755f144aa84a1fb7d256e38 (commit)
       via  179a88f7f91130bc9ed3f62db06b7107909c0f17 (commit)
       via  26d46e62d77bdac3c3593d4e45854ad6ea78c6f2 (commit)
       via  7542f04ef01f0c98f79d855104dd63f4304f51a1 (commit)
       via  107456deabeb1c7b634264ab21818d64ae270ffe (commit)
       via  103be0f063fb84666222b0388298d9aabe8f3588 (commit)
       via  63b12f0554e013feafe2b86c19bb1b0c33659a8f (commit)
       via  6fd66ac74c0027650ef43577fdbe4d7f236051f2 (commit)
       via  238a89c5e410f61d2786cffca0a55dcf50325cd4 (commit)
       via  7bd3bcfebb31726b090ee1e94a598f7b1ae97ff8 (commit)
       via  483b15745ae9f8ea4490ca5fb87cb9c1405785a4 (commit)
       via  3fa74e6cd934b778a46812e85aacb75f5bb8ebf0 (commit)
       via  abef1f2b99a19695e75d2b8caca0409d68377a68 (commit)
       via  68a5e2c18948f7654ff9e1ba942e6384223eafd1 (commit)
       via  1ee91b8dc930c4a3093ada1ff16e46247143415f (commit)
       via  de9e84839d6034a7ceeb77c774f2e36e48cbd97d (commit)
       via  bee9c58b7e871312ed9f00f244dcfc3ea7888c0d (commit)
       via  104ac57ff96d3a8854569062910c42f7a9f762af (commit)
       via  6b02e7db494f5b445c71de1f59b034854008002b (commit)
       via  5371d4e89fdf618acf847a6337a8c91b99c673fa (commit)
       via  db6edb160e34a79d59886896b36650ac4e089539 (commit)
      from  63ef85dc45ff48ac0b216fac25786db84ec85eb1 (commit)

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

- Log -----------------------------------------------------------------
commit e35c7e8e719cdaf8771b9b03b06be508c35f9949
Merge: 63ef85d 79be832
Author: Keith Seitz <keiths@redhat.com>
Date:   Mon Mar 26 13:56:14 2012 -0700

    Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite

commit 79be8325606facdce0467e5e1b54b30513f8f727
Author: ozapawandeep <ozapawandeep>
Date:   Mon Mar 26 18:18:37 2012 +0000

    MAINTAINERS (Write After Approval): Add myself to the list.

commit b0e5cb87d66e1c74613ba923664bef9547b96172
Author: Pedro Alves <pedro@codesourcery.com>
Date:   Mon Mar 26 13:54:57 2012 +0000

    2012-03-26  Pedro Alves  <palves@redhat.com>
    
    	* server.c (handle_qxfer_libraries): Don't bail early if
    	the_target->qxfer_libraries_svr4 is not NULL.

commit a5cb0e3d12758e08a1ccc7f6f73529bc102a6d31
Author: Pedro Alves <pedro@codesourcery.com>
Date:   Mon Mar 26 12:39:19 2012 +0000

    2012-03-26  Pedro Alves  <palves@redhat.com>
    
    	* linux-low.c (linux_qxfer_libraries_svr4): Fix pasto in comment.

commit 57feba1a12c978c57836cd9a78bace3aa68ff881
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Mon Mar 26 02:18:43 2012 +0000

    sim: add a proper sim_core_trans_addr prototype
    
    The common code has a sim_core_trans_addr() helper that only the m32r code
    uses.  Move the inline extern in the m32r code to the proper common header.
    
    Signed-off-by: Mike Frysinger <vapier@gentoo.org>

commit 1ba1689e5d9a078016564b0f40729917563a9bb1
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Mon Mar 26 00:00:03 2012 +0000

    *** empty log message ***

commit 994022538d9a8c3f57f94f90b21f9796d54f6ea3
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Sun Mar 25 23:00:05 2012 +0000

    daily update

commit bb4f55dbcc7aa2bf1b0cdd439b7088d9ea7e9b00
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Sun Mar 25 16:51:46 2012 +0000

    sim: bfin: skip .c/.S tests if no compiler is available
    
    Similar to logic in the cris exp, attempt a simple compile and if it fails
    (presumably due to the compiler being broken), skip all the related tests.
    Fortunately, most tests (~600 out of ~800) are pure assembly, so people should
    still get pretty good coverage.
    
    Signed-off-by: Mike Frysinger <vapier@gentoo.org>

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

Summary of changes:
 bfd/ChangeLog                                     |   21 ++
 bfd/bfd-in.h                                      |    3 +
 bfd/bfd-in2.h                                     |    3 +
 bfd/elf.c                                         |   13 +-
 bfd/elf64-ppc.c                                   |    9 +-
 bfd/elflink.c                                     |   21 +-
 bfd/linker.c                                      |  143 +++++----
 bfd/version.h                                     |    2 +-
 gdb/ChangeLog                                     |   34 ++
 gdb/MAINTAINERS                                   |    3 +-
 gdb/NEWS                                          |    8 +-
 gdb/doc/ChangeLog                                 |    7 +
 gdb/doc/gdb.texinfo                               |   73 ++++
 gdb/gdbserver/ChangeLog                           |   21 ++
 gdb/gdbserver/linux-low.c                         |   36 ++-
 gdb/gdbserver/server.c                            |    4 -
 gdb/jit.c                                         |   13 +-
 gdb/python/py-value.c                             |   43 +++
 gdb/sparc-linux-nat.c                             |    2 +-
 gdb/sparc-nat.c                                   |    2 +-
 gdb/testsuite/ChangeLog                           |   12 +
 gdb/testsuite/gdb.python/Makefile.in              |    2 +-
 gdb/testsuite/gdb.python/py-value-cc.exp          |   48 +++
 gdb/testsuite/gdb.python/py-value.cc              |   39 +++
 gdb/testsuite/lib/gdb.exp                         |    5 +-
 gdb/version.in                                    |    2 +-
 opcodes/ChangeLog                                 |    4 +
 opcodes/mips-dis.c                                |    8 +
 sim/arm/ChangeLog                                 |    4 +
 sim/arm/aclocal.m4                                |   11 +-
 sim/arm/config.in                                 |   32 ++
 sim/arm/configure                                 |  304 ++++++++++-------
 sim/avr/ChangeLog                                 |    4 +
 sim/avr/aclocal.m4                                |   11 +-
 sim/avr/config.in                                 |   32 ++
 sim/avr/configure                                 |  304 ++++++++++-------
 sim/bfin/ChangeLog                                |    4 +
 sim/bfin/aclocal.m4                               |   11 +-
 sim/bfin/config.in                                |   32 ++
 sim/bfin/configure                                |  370 ++++++++++++--------
 sim/common/ChangeLog                              |   21 ++
 sim/common/acinclude.m4                           |   65 +++--
 sim/common/aclocal.m4                             |   11 +-
 sim/common/config.in                              |   32 ++
 sim/common/configure                              |  298 ++++++++++-------
 sim/common/nrun.c                                 |   16 +
 sim/common/sim-core.h                             |    8 +
 sim/cr16/ChangeLog                                |    4 +
 sim/cr16/aclocal.m4                               |   11 +-
 sim/cr16/config.in                                |   32 ++
 sim/cr16/configure                                |  376 +++++++++++++--------
 sim/cris/ChangeLog                                |    4 +
 sim/cris/aclocal.m4                               |   11 +-
 sim/cris/config.in                                |   35 ++
 sim/cris/configure                                |  376 +++++++++++++--------
 sim/d10v/ChangeLog                                |    4 +
 sim/d10v/aclocal.m4                               |   11 +-
 sim/d10v/config.in                                |   32 ++
 sim/d10v/configure                                |  376 +++++++++++++--------
 sim/erc32/ChangeLog                               |    4 +
 sim/erc32/aclocal.m4                              |   11 +-
 sim/erc32/config.in                               |   32 ++
 sim/erc32/configure                               |  298 ++++++++++-------
 sim/frv/ChangeLog                                 |    4 +
 sim/frv/aclocal.m4                                |   11 +-
 sim/frv/config.in                                 |   32 ++
 sim/frv/configure                                 |  304 ++++++++++-------
 sim/h8300/ChangeLog                               |    4 +
 sim/h8300/aclocal.m4                              |   11 +-
 sim/h8300/config.in                               |   32 ++
 sim/h8300/configure                               |  304 ++++++++++-------
 sim/igen/ChangeLog                                |    4 +
 sim/igen/configure                                |  116 +++++--
 sim/iq2000/ChangeLog                              |    4 +
 sim/iq2000/aclocal.m4                             |   11 +-
 sim/iq2000/config.in                              |   32 ++
 sim/iq2000/configure                              |  304 ++++++++++-------
 sim/lm32/ChangeLog                                |    4 +
 sim/lm32/aclocal.m4                               |   11 +-
 sim/lm32/config.in                                |   35 ++
 sim/lm32/configure                                |  304 ++++++++++-------
 sim/m32c/ChangeLog                                |    4 +
 sim/m32c/aclocal.m4                               |   11 +-
 sim/m32c/config.in                                |   34 ++-
 sim/m32c/configure                                |  304 ++++++++++-------
 sim/m32r/ChangeLog                                |    8 +
 sim/m32r/aclocal.m4                               |   11 +-
 sim/m32r/config.in                                |   32 ++
 sim/m32r/configure                                |  304 ++++++++++-------
 sim/m32r/traps-linux.c                            |    1 -
 sim/m68hc11/ChangeLog                             |    4 +
 sim/m68hc11/aclocal.m4                            |   11 +-
 sim/m68hc11/config.in                             |   35 ++
 sim/m68hc11/configure                             |  376 +++++++++++++--------
 sim/mcore/ChangeLog                               |    4 +
 sim/mcore/aclocal.m4                              |   11 +-
 sim/mcore/config.in                               |   32 ++
 sim/mcore/configure                               |  304 ++++++++++-------
 sim/microblaze/ChangeLog                          |    4 +
 sim/microblaze/aclocal.m4                         |   11 +-
 sim/microblaze/config.in                          |   32 ++
 sim/microblaze/configure                          |  304 ++++++++++-------
 sim/mips/ChangeLog                                |    4 +
 sim/mips/aclocal.m4                               |   11 +-
 sim/mips/config.in                                |   32 ++
 sim/mips/configure                                |  378 +++++++++++++--------
 sim/mn10300/ChangeLog                             |    4 +
 sim/mn10300/aclocal.m4                            |   11 +-
 sim/mn10300/config.in                             |   35 ++
 sim/mn10300/configure                             |  376 +++++++++++++--------
 sim/moxie/ChangeLog                               |    4 +
 sim/moxie/aclocal.m4                              |   11 +-
 sim/moxie/config.in                               |   47 +++
 sim/moxie/configure                               |  304 ++++++++++-------
 sim/rl78/ChangeLog                                |    4 +
 sim/rl78/aclocal.m4                               |   11 +-
 sim/rl78/config.in                                |   38 ++-
 sim/rl78/configure                                |  304 ++++++++++-------
 sim/rx/ChangeLog                                  |    9 +
 sim/rx/aclocal.m4                                 |   11 +-
 sim/rx/config.in                                  |   44 ++-
 sim/rx/configure                                  |  310 ++++++++++-------
 sim/rx/configure.ac                               |    6 +-
 sim/sh/ChangeLog                                  |    4 +
 sim/sh/aclocal.m4                                 |   11 +-
 sim/sh/config.in                                  |   32 ++
 sim/sh/configure                                  |  304 ++++++++++-------
 sim/sh64/ChangeLog                                |    4 +
 sim/sh64/aclocal.m4                               |   11 +-
 sim/sh64/config.in                                |   32 ++
 sim/sh64/configure                                |  304 ++++++++++-------
 sim/testsuite/ChangeLog                           |    4 +
 sim/testsuite/configure                           |    3 +
 sim/testsuite/sim/bfin/ChangeLog                  |   16 +
 sim/testsuite/sim/bfin/allinsn.exp                |   28 ++
 sim/testsuite/sim/bfin/c_dsp32mac_dr_a1a0.s       |    2 +-
 sim/testsuite/sim/bfin/c_dsp32mac_dr_a1a0_iutsh.s |    2 +-
 sim/testsuite/sim/bfin/c_dsp32mac_dr_a1a0_m.s     |    2 +-
 sim/testsuite/sim/bfin/c_dsp32shift_vmaxvmax.s    |    2 +-
 sim/testsuite/sim/bfin/c_dsp32shiftim_af_s.s      |    2 +-
 sim/testsuite/sim/bfin/fact.s                     |    6 +-
 sim/testsuite/sim/cris/ChangeLog                  |    9 +
 sim/testsuite/sim/cris/c/clone5.c                 |    2 +-
 sim/testsuite/sim/cris/c/fcntl1.c                 |    2 +-
 sim/testsuite/sim/cris/c/kill2.c                  |    2 +-
 sim/testsuite/sim/cris/c/kill3.c                  |    2 +-
 sim/testsuite/sim/cris/c/mprotect1.c              |    2 +-
 sim/testsuite/sim/cris/c/pipe5.c                  |    2 +-
 sim/testsuite/sim/cris/c/readlink5.c              |    2 +-
 sim/testsuite/sim/cris/c/rtsigprocmask1.c         |    2 +-
 sim/testsuite/sim/cris/c/rtsigsuspend1.c          |    2 +-
 sim/testsuite/sim/cris/c/sig10.c                  |    2 +-
 sim/testsuite/sim/cris/c/sig11.c                  |    2 +-
 sim/testsuite/sim/cris/c/sig3.c                   |    2 +-
 sim/testsuite/sim/cris/c/sig4.c                   |    2 +-
 sim/testsuite/sim/cris/c/sig5.c                   |    2 +-
 sim/testsuite/sim/cris/c/sig6.c                   |    2 +-
 sim/testsuite/sim/cris/c/sig7.c                   |    2 +-
 sim/testsuite/sim/cris/c/sig8.c                   |    2 +-
 sim/testsuite/sim/cris/c/sigreturn1.c             |    2 +-
 sim/testsuite/sim/cris/c/sigreturn2.c             |    2 +-
 sim/testsuite/sim/cris/c/syscall1.c               |    2 +-
 sim/testsuite/sim/cris/c/syscall2.c               |    2 +-
 sim/testsuite/sim/cris/c/syscall3.c               |    2 +-
 sim/testsuite/sim/cris/c/syscall4.c               |    2 +-
 sim/testsuite/sim/cris/c/sysctl2.c                |    2 +-
 sim/v850/ChangeLog                                |    4 +
 sim/v850/aclocal.m4                               |   11 +-
 sim/v850/config.in                                |   32 ++
 sim/v850/configure                                |  376 +++++++++++++--------
 170 files changed, 6758 insertions(+), 3577 deletions(-)
 create mode 100644 gdb/testsuite/gdb.python/py-value-cc.exp
 create mode 100644 gdb/testsuite/gdb.python/py-value.cc

First 500 lines of diff:
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index da9f409..04c3b31 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,24 @@
+2012-03-23  Alan Modra  <amodra@gmail.com>
+
+	* elf.c (assign_file_positions_for_non_load_sections): Don't warn
+	on empty alloc sections.
+
+2012-03-23  Alan Modra  <amodra@gmail.com>
+
+	* linker.c (_bfd_nearby_section): New function, split out from..
+	(fix_syms): ..here.
+	* bfd-in.h (_bfd_nearby_section): Declare.
+	* bfd-in2.h: Regenerate.
+	* elflink.c (elf_link_input_bfd): Don't use text_index_section or
+	data_index_section with ld -q or ld -r output relocs against
+	stripped output sections.  Instead use _bfd_nearby_section.
+
+2012-03-23  Alan Modra  <amodra@gmail.com>
+
+	PR binutils/13894
+	* elf64-ppc.c (opd_entry_value): Read full symbol table when
+	sym hashes unavailable.
+
 2012-03-21  Eliot Dresselhaus  <eliot@sonic.net>
 
 	* elf32-tic6x.c (elf32_tic6x_merge_private_bfd_data): Return TRUE
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 40ed786..c331f3b 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -705,6 +705,9 @@ extern int bfd_get_sign_extend_vma
 extern struct bfd_section *_bfd_elf_tls_setup
   (bfd *, struct bfd_link_info *);
 
+extern struct bfd_section *
+_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma);
+
 extern void _bfd_fix_excluded_sec_syms
   (bfd *, struct bfd_link_info *);
 
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index bea3a05..61513f2 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -712,6 +712,9 @@ extern int bfd_get_sign_extend_vma
 extern struct bfd_section *_bfd_elf_tls_setup
   (bfd *, struct bfd_link_info *);
 
+extern struct bfd_section *
+_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma);
+
 extern void _bfd_fix_excluded_sec_syms
   (bfd *, struct bfd_link_info *);
 
diff --git a/bfd/elf.c b/bfd/elf.c
index 5aabeeb..df43a6a 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -4820,12 +4820,13 @@ assign_file_positions_for_non_load_sections (bfd *abfd,
 	BFD_ASSERT (hdr->sh_offset == hdr->bfd_section->filepos);
       else if ((hdr->sh_flags & SHF_ALLOC) != 0)
 	{
-	  (*_bfd_error_handler)
-	    (_("%B: warning: allocated section `%s' not in segment"),
-	     abfd,
-	     (hdr->bfd_section == NULL
-	      ? "*unknown*"
-	      : hdr->bfd_section->name));
+	  if (hdr->sh_size != 0)
+	    (*_bfd_error_handler)
+	      (_("%B: warning: allocated section `%s' not in segment"),
+	       abfd,
+	       (hdr->bfd_section == NULL
+		? "*unknown*"
+		: hdr->bfd_section->name));
 	  /* We don't need to page align empty sections.  */
 	  if ((abfd->flags & D_PAGED) != 0 && hdr->sh_size != 0)
 	    off += vma_page_aligned_bias (hdr->sh_addr, off,
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index f4f5d0b..e7a01c2 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -5585,15 +5585,18 @@ opd_entry_value (asection *opd_sec,
 	      unsigned long symndx = ELF64_R_SYM (look->r_info);
 	      asection *sec;
 
-	      if (symndx < symtab_hdr->sh_info)
+	      if (symndx < symtab_hdr->sh_info
+		  || elf_sym_hashes (opd_bfd) == NULL)
 		{
 		  Elf_Internal_Sym *sym;
 
 		  sym = (Elf_Internal_Sym *) symtab_hdr->contents;
 		  if (sym == NULL)
 		    {
-		      sym = bfd_elf_get_elf_syms (opd_bfd, symtab_hdr,
-						  symtab_hdr->sh_info,
+		      size_t symcnt = symtab_hdr->sh_info;
+		      if (elf_sym_hashes (opd_bfd) == NULL)
+			symcnt = symtab_hdr->sh_size / symtab_hdr->sh_entsize;
+		      sym = bfd_elf_get_elf_syms (opd_bfd, symtab_hdr, symcnt,
 						  0, NULL, NULL, NULL);
 		      if (sym == NULL)
 			break;
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 7f9ec60..3236911 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -9747,23 +9747,12 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd)
 			      r_symndx = osec->target_index;
 			      if (r_symndx == STN_UNDEF)
 				{
-				  struct elf_link_hash_table *htab;
-				  asection *oi;
-
-				  htab = elf_hash_table (finfo->info);
-				  oi = htab->text_index_section;
-				  if ((osec->flags & SEC_READONLY) == 0
-				      && htab->data_index_section != NULL)
-				    oi = htab->data_index_section;
-
-				  if (oi != NULL)
-				    {
-				      irela->r_addend += osec->vma - oi->vma;
-				      r_symndx = oi->target_index;
-				    }
+				  irela->r_addend += osec->vma;
+				  osec = _bfd_nearby_section (output_bfd, osec,
+							      osec->vma);
+				  irela->r_addend -= osec->vma;
+				  r_symndx = osec->target_index;
 				}
-
-			      BFD_ASSERT (r_symndx != STN_UNDEF);
 			    }
 			}
 
diff --git a/bfd/linker.c b/bfd/linker.c
index 0404474..2f8ecbb 100644
--- a/bfd/linker.c
+++ b/bfd/linker.c
@@ -3130,6 +3130,81 @@ _bfd_generic_section_already_linked (bfd *abfd ATTRIBUTE_UNUSED,
   return FALSE;
 }
 
+/* Choose a neighbouring section to S in OBFD that will be output, or
+   the absolute section if ADDR is out of bounds of the neighbours.  */
+
+asection *
+_bfd_nearby_section (bfd *obfd, asection *s, bfd_vma addr)
+{
+  asection *next, *prev, *best;
+
+  /* Find preceding kept section.  */
+  for (prev = s->prev; prev != NULL; prev = prev->prev)
+    if ((prev->flags & SEC_EXCLUDE) == 0
+	&& !bfd_section_removed_from_list (obfd, prev))
+      break;
+
+  /* Find following kept section.  Start at prev->next because
+     other sections may have been added after S was removed.  */
+  if (s->prev != NULL)
+    next = s->prev->next;
+  else
+    next = s->owner->sections;
+  for (; next != NULL; next = next->next)
+    if ((next->flags & SEC_EXCLUDE) == 0
+	&& !bfd_section_removed_from_list (obfd, next))
+      break;
+
+  /* Choose better of two sections, based on flags.  The idea
+     is to choose a section that will be in the same segment
+     as S would have been if it was kept.  */
+  best = next;
+  if (prev == NULL)
+    {
+      if (next == NULL)
+	best = bfd_abs_section_ptr;
+    }
+  else if (next == NULL)
+    best = prev;
+  else if (((prev->flags ^ next->flags)
+	    & (SEC_ALLOC | SEC_THREAD_LOCAL | SEC_LOAD)) != 0)
+    {
+      if (((next->flags ^ s->flags)
+	   & (SEC_ALLOC | SEC_THREAD_LOCAL)) != 0
+	  /* We prefer to choose a loaded section.  Section S
+	     doesn't have SEC_LOAD set (it being excluded, that
+	     part of the flag processing didn't happen) so we
+	     can't compare that flag to those of NEXT and PREV.  */
+	  || ((prev->flags & SEC_LOAD) != 0
+	      && (next->flags & SEC_LOAD) == 0))
+	best = prev;
+    }
+  else if (((prev->flags ^ next->flags) & SEC_READONLY) != 0)
+    {
+      if (((next->flags ^ s->flags) & SEC_READONLY) != 0)
+	best = prev;
+    }
+  else if (((prev->flags ^ next->flags) & SEC_CODE) != 0)
+    {
+      if (((next->flags ^ s->flags) & SEC_CODE) != 0)
+	best = prev;
+    }
+  else
+    {
+      /* Flags we care about are the same.  Prefer the following
+	 section if that will result in a positive valued sym.  */
+      if (addr < next->vma)
+	best = prev;
+    }
+
+  /* Refuse to choose a section for which we are out of bounds.  */
+  /* ??? This may make most of the above moot.  */
+  if (addr < best->vma || addr > best->vma + best->size)
+    best = bfd_abs_section_ptr;
+
+  return best;
+}
+
 /* Convert symbols in excluded output sections to use a kept section.  */
 
 static bfd_boolean
@@ -3146,74 +3221,10 @@ fix_syms (struct bfd_link_hash_entry *h, void *data)
 	  && (s->output_section->flags & SEC_EXCLUDE) != 0
 	  && bfd_section_removed_from_list (obfd, s->output_section))
 	{
-	  asection *op, *op1;
+	  asection *op;
 
 	  h->u.def.value += s->output_offset + s->output_section->vma;
-
-	  /* Find preceding kept section.  */
-	  for (op1 = s->output_section->prev; op1 != NULL; op1 = op1->prev)
-	    if ((op1->flags & SEC_EXCLUDE) == 0
-		&& !bfd_section_removed_from_list (obfd, op1))
-	      break;
-
-	  /* Find following kept section.  Start at prev->next because
-	     other sections may have been added after S was removed.  */
-	  if (s->output_section->prev != NULL)
-	    op = s->output_section->prev->next;
-	  else
-	    op = s->output_section->owner->sections;
-	  for (; op != NULL; op = op->next)
-	    if ((op->flags & SEC_EXCLUDE) == 0
-		&& !bfd_section_removed_from_list (obfd, op))
-	      break;
-
-	  /* Choose better of two sections, based on flags.  The idea
-	     is to choose a section that will be in the same segment
-	     as S would have been if it was kept.  */
-	  if (op1 == NULL)
-	    {
-	      if (op == NULL)
-		op = bfd_abs_section_ptr;
-	    }
-	  else if (op == NULL)
-	    op = op1;
-	  else if (((op1->flags ^ op->flags)
-		    & (SEC_ALLOC | SEC_THREAD_LOCAL | SEC_LOAD)) != 0)
-	    {
-	      if (((op->flags ^ s->flags)
-		   & (SEC_ALLOC | SEC_THREAD_LOCAL)) != 0
-		  /* We prefer to choose a loaded section.  Section S
-		     doesn't have SEC_LOAD set (it being excluded, that
-		     part of the flag processing didn't happen) so we
-		     can't compare that flag to those of OP and OP1.  */
-		  || ((op1->flags & SEC_LOAD) != 0
-		      && (op->flags & SEC_LOAD) == 0))
-		op = op1;
-	    }
-	  else if (((op1->flags ^ op->flags) & SEC_READONLY) != 0)
-	    {
-	      if (((op->flags ^ s->flags) & SEC_READONLY) != 0)
-		op = op1;
-	    }
-	  else if (((op1->flags ^ op->flags) & SEC_CODE) != 0)
-	    {
-	      if (((op->flags ^ s->flags) & SEC_CODE) != 0)
-		op = op1;
-	    }
-	  else
-	    {
-	      /* Flags we care about are the same.  Prefer the following
-		 section if that will result in a positive valued sym.  */
-	      if (h->u.def.value < op->vma)
-		op = op1;
-	    }
-
-	  /* Refuse to choose a section for which we are out of bounds.  */
-	  /* ??? This may make most of the above moot.  */
-	  if (h->u.def.value < op->vma
-	      || h->u.def.value > op->vma + op->size)
-	    op = bfd_abs_section_ptr;
-
+	  op = _bfd_nearby_section (obfd, s->output_section, h->u.def.value);
 	  h->u.def.value -= op->vma;
 	  h->u.def.section = op;
 	}
diff --git a/bfd/version.h b/bfd/version.h
index ace12b2..0912d1c 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20120322
+#define BFD_VERSION_DATE 20120326
 #define BFD_VERSION @bfd_version@
 #define BFD_VERSION_STRING  @bfd_version_package@ @bfd_version_string@
 #define REPORT_BUGS_TO @report_bugs_to@
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 000b921..5304e17 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,37 @@
+2012-03-26 Oza Pawandeep  <oza.pawandeep@gmail.com>
+
+        * MAINTAINERS (Write After Approval): Add myself to the list.
+
+2012-03-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	* NEWS (set breakpoint condition-evaluation): Change "gdb" to "host".
+	Describe also the option "auto".
+
+2012-03-22  Richard Henderson  <rth@redhat.com>
+
+	* sparc-linux-nat.c (_initialize_sparc_linux_nat): Fix prototype.
+	* sparc-nat.c (sparc_xfer_wcookie): Make static.
+
+2012-03-22  Richard Henderson  <rth@redhat.com>
+
+	* jit.c (jit_read_code_entry): Compute alignment and offset of
+	int64_t member before computing entry_size.
+
+2012-03-22  Siva Chandra Reddy  <sivachandra@google.com>
+
+	Python scripting: Add new method Value.referenced_value to
+	gdb.Value which can dereference pointer as well as reference
+	values.
+	* NEWS: Add entry under 'Python scripting' about the new method
+	Value.referenced_value on gdb.Value objects.
+	* python/py-value.c (valpy_referenced_value): New function
+	defining a new method on gdb.Value objects which can dereference
+	pointer and reference values.
+
+2012-03-22  Siva Chandra Reddy  <sivachandra@google.com>
+
+	* MAINTAINERS (Write After Approval): Add myself to the list.
+
 2012-03-21  Kevin Buettner  <kevinb@redhat.com>
 
 	* symtab.c (skip_prologue_sal): Change test to check for "main()"
diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS
index a92216f..6dc5d67 100644
--- a/gdb/MAINTAINERS
+++ b/gdb/MAINTAINERS
@@ -590,6 +590,7 @@ Marek Polacek					mpolacek@redhat.com
 Vladimir Prus                                   vladimir@codesourcery.com
 Yao Qi						yao@codesourcery.com
 Qinwei						qinwei@sunnorth.com.cn
+Siva Chandra Reddy				sivachandra@google.com
 Matt Rice					ratmice@gmail.com
 Frederic Riss					frederic.riss@st.com
 Aleksandar Ristovski				aristovski@qnx.com
@@ -648,7 +649,7 @@ Jie Zhang					jzhang918@gmail.com
 Wu Zhou						woodzltc@cn.ibm.com
 Yoshinori Sato					ysato@users.sourceforge.jp
 Hui Zhu						teawater@gmail.com
-
+Oza Pawandeep					oza.pawandeep@gmail.com
 
 			Past Maintainers
 
diff --git a/gdb/NEWS b/gdb/NEWS
index d23a773..f21921a 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -25,6 +25,9 @@
      frame in order to compute its value, and the latter computes the
      symbol's value.
 
+  ** A new method 'referenced_value' on gdb.Value objects which can
+     dereference pointer as well as C++ reference values.
+
 * GDBserver now supports stdio connections.
   E.g. (gdb) target remote | ssh myhost gdbserver - hello
 
@@ -99,8 +102,9 @@ HP OpenVMS ia64			ia64-hp-openvms*
 
 set breakpoint condition-evaluation
 show breakpoint condition-evaluation
-  Controls whether breakpoint conditions are evaluated by GDB ("gdb") or by
-  GDBserver ("target").
+  Controls whether breakpoint conditions are evaluated by GDB ("host") or by
+  GDBserver ("target").  Default option "auto" chooses the most efficient
+  available mode.
   This option can improve debugger efficiency depending on the speed of the
   target.
 
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 92e3e1b..ff7786f 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,10 @@
+2012-03-22  Siva Chandra Reddy  <sivachandra@google.com>
+
+	* gdb.texinfo (Python API/Values From Inferior): Add description
+	about the new method Value.referenced_value.  Add description on
+	how Value.dereference is different (and similar) to
+	Value.referenced_value.
+
 2012-03-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
 	* gdb.texinfo (File Options): Describe --init-command=FILE, -ix and
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 677af3b..dbf1a71 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -22136,6 +22136,79 @@ bar = foo.dereference ()
 
 The result @code{bar} will be a @code{gdb.Value} object holding the
 value pointed to by @code{foo}.
+
+A similar function @code{Value.referenced_value} exists which also
+returns @code{gdb.Value} objects corresonding to the values pointed to
+by pointer values (and additionally, values referenced by reference
+values).  However, the behavior of @code{Value.dereference}
+differs from @code{Value.referenced_value} by the fact that the
+behavior of @code{Value.dereference} is identical to applying the C
+unary operator @code{*} on a given value.  For example, consider a
+reference to a pointer @code{ptrref}, declared in your C@t{++} program
+as
+
+@smallexample
+typedef int *intptr;
+...
+int val = 10;
+intptr ptr = &val;
+intptr &ptrref = ptr;
+@end smallexample
+
+Though @code{ptrref} is a reference value, one can apply the method
+@code{Value.dereference} to the @code{gdb.Value} object corresponding
+to it and obtain a @code{gdb.Value} which is identical to that
+corresponding to @code{val}.  However, if you apply the method
+@code{Value.referenced_value}, the result would be a @code{gdb.Value}
+object identical to that corresponding to @code{ptr}.
+
+@smallexample
+py_ptrref = gdb.parse_and_eval ("ptrref")
+py_val = py_ptrref.dereference ()
+py_ptr = py_ptrref.referenced_value ()
+@end smallexample
+
+The @code{gdb.Value} object @code{py_val} is identical to that
+corresponding to @code{val}, and @code{py_ptr} is identical to that
+corresponding to @code{ptr}.  In general, @code{Value.dereference} can
+be applied whenever the C unary operator @code{*} can be applied
+to the corresponding C value.  For those cases where applying both
+@code{Value.dereference} and @code{Value.referenced_value} is allowed,
+the results obtained need not be identical (as we have seen in the above
+example).  The results are however identical when applied on
+@code{gdb.Value} objects corresponding to pointers (@code{gdb.Value}
+objects with type code @code{TYPE_CODE_PTR}) in a C/C@t{++} program.
+@end defun
+
+@defun Value.referenced_value ()
+For pointer or reference data types, this method returns a new
+@code{gdb.Value} object corresponding to the value referenced by the
+pointer/reference value.  For pointer data types,
+@code{Value.dereference} and @code{Value.referenced_value} produce
+identical results.  The difference between these methods is that
+@code{Value.dereference} cannot get the values referenced by reference
+values.  For example, consider a reference to an @code{int}, declared
+in your C@t{++} program as
+
+@smallexample
+int val = 10;
+int &ref = val;
+@end smallexample
+
+@noindent
+then applying @code{Value.dereference} to the @code{gdb.Value} object
+corresponding to @code{ref} will result in an error, while applying
+@code{Value.referenced_value} will result in a @code{gdb.Value} object
+identical to that corresponding to @code{val}.
+
+@smallexample
+py_ref = gdb.parse_and_eval ("ref")
+er_ref = py_ref.dereference ()       # Results in error
+py_val = py_ref.referenced_value ()  # Returns the referenced value
+@end smallexample
+
+The @code{gdb.Value} object @code{py_val} is identical to that
+corresponding to @code{val}.
 @end defun
 


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


             reply	other threads:[~2012-03-26 21:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-26 21:41 kseitz [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-03-30 20:55 kseitz
2012-03-19 19:24 kseitz
2012-03-19 17:21 kseitz
2012-03-16 23:48 kseitz
2012-03-15 19:14 kseitz
2012-03-14 18:54 kseitz
2012-03-13 21:22 kseitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120326214130.4399.qmail@sourceware.org \
    --to=kseitz@sourceware.org \
    --cc=archer-commits@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).