public inbox for archer-commits@sourceware.org help / color / mirror / Atom feed
From: sergiodj@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-sergiodj-stap: Merge remote-tracking branch 'origin/master' into archer-sergiodj-stap Date: Wed, 25 Jan 2012 18:44:00 -0000 [thread overview] Message-ID: <20120125184356.18336.qmail@sourceware.org> (raw) The branch, archer-sergiodj-stap has been updated via 8c800dbe17ff4b5bbc5ace4be82b1a5f2ac453cf (commit) via 01f83aeea8f8b58b54eb7e1acaf2f056d4b14f07 (commit) via 74ce40a2187959252051f46f9988f1dbec6d6393 (commit) via eb317823c809dd8781672e9d34d5eb663d65153d (commit) via 98b6395f8ed8a558c9e8b8d261680d0a95dc6010 (commit) via 098e388b18b0d6e75e916f68f875d8ab4073ef59 (commit) via 23be81b20039c057ad0af30082f6f8a16a7643e9 (commit) via a2127f5b008cc30a6949ac111fb460c1e91650b3 (commit) via 011ad04db6bd4938623a2d3fb1ec95d360db4387 (commit) via 59d922bc748faf76b7f7477953ae34fe7d043e11 (commit) via 5eb09c030ab6d18adeea75261b148ed325c51cc0 (commit) via ee3529349cce157cbef4833203fd0912a89e9d73 (commit) via 711a646b7940a7b7cc49c31a5a267b0e2371938f (commit) via 55ebf19b5083ffb66350d1111b18bbdc745187fe (commit) via 9aac6fcf549f3f5779287df68d4344c1cc0cd352 (commit) via 7b869d6eba3bbf50cfa0f5ea9bf5e0984bdf087f (commit) via 2bfeecf636f5790a7e850e11c7936c4d9814d8ef (commit) via 99ffd3e69abb4c0ce285577931f29b53d947176b (commit) via 0e48219c65a37bf1b8855881b3b2c3f362defedd (commit) via f715ea2c9f96348a287c29e6d9619a8ce2a66f83 (commit) via f31d5ba21d7c2ffe290d0e41b8d2703f9ca0aa7a (commit) via 1ace069643a34f84b1c555c01e728b9d0865c748 (commit) via c7ace98603ceb642c66e03595c79089b35674d3f (commit) via 7d249f1c6358c5494c24458238675b7ed92f54ff (commit) via 247a6fbfda881aa9423535c33a6844616647c3b6 (commit) via e45e48a58cc293da96922eea1c149a98450343ee (commit) via 78a9133bb56807476f928df323c6a46459a4cc01 (commit) via 6ac081eef86d773aad9d6982323e1f192e7b6e63 (commit) via 431676a00b6847cb19f3bc8dad1674c45310e6e5 (commit) via 28772da2396a4d50efcdd181b76c53911e8dbde5 (commit) via b3b45e475a0561e54082cae1b5025056ad0590d3 (commit) via 75eb9ef090c2f4836280ae7f17b05bc1b27cc66a (commit) via 475df95b6ad865d01dd26dad88438e2b8e9318d5 (commit) via 544ce285e4bbbea66b65d11fdc72863a2d288975 (commit) via 8e1399302ea757c66289d9847cd33b95a89fed81 (commit) via 18136deaf55cc69935537f83c1d0d03dae9f71e7 (commit) via d20616615dcda64740247946bfbe8a725708ec80 (commit) via 8deba5c6ed4af7b2e1d209bd85a061dece34198a (commit) via f076ba40346bb343e0f99cdf3217d10c01a7efc7 (commit) via a863c2dd217a0e800eed8f4cbc860a5951a8581f (commit) via 9c64052db7b6e426f361c8bcef0d3cba745ad927 (commit) via cba35773df17a05ddfffdc7432c5335b16bd329f (commit) via b1805119882385f115008912122d043431aa2019 (commit) via e275619a2e8d64964b675b0e85bb7c69e2a7dad0 (commit) via f8cdeea569d34d96c29b22f12dcc0c82bef1bd5a (commit) via a230ffaf9414998a3ea403773b26d3abcf9c6507 (commit) via f3a8d239696d4bb787e96e83695bed9099d89fed (commit) via e9d6c476e825d7d8156ff4d3c267f85d3f068413 (commit) via c79c96b1d8e33b2d41597b5c673c8f4422dd553a (commit) via f3c9794013f9b101cc0cfc5de4cbb94c5661480f (commit) via f34a37606ae0aeb0e93da23048694e9c36d06e1e (commit) via cd2c5e225ec1b4f5223ca15b4bdf062fde711e9c (commit) via 0142f2719099202a66d5bb245499b25070f166b2 (commit) via a0007463542d1f4d50ac972756c23e2d58b14327 (commit) via 54ac228ae22899c143ad86ca4207ee9cd6f2f6b0 (commit) via 5758a500f985367b0a6d8b1892d6b963f07a7f40 (commit) via 8b21d15e5ce3a2759c05540e2a76778107660574 (commit) via 920e75a6e9f74504c77bc37bf1d631edfb5ca9ff (commit) via 27b7c4cd105751c47820c79330d328cad5b45694 (commit) via 8bd41f740b9e742ff28cef15481b6d29cbb6477b (commit) via ca89e432c66cae420f25ebf60f045cc733a394ab (commit) via 12bc4c0e6550d463e2fcf2e5204a67a61502a1cd (commit) from 4ec9691d55716a9434f9c202bc77c92f831a1242 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 8c800dbe17ff4b5bbc5ace4be82b1a5f2ac453cf Merge: 4ec9691 01f83ae Author: Sergio Durigan Junior <sergiodj@redhat.com> Date: Wed Jan 25 16:43:40 2012 -0200 Merge remote-tracking branch 'origin/master' into archer-sergiodj-stap Conflicts: gdb/breakpoint.h commit 01f83aeea8f8b58b54eb7e1acaf2f056d4b14f07 Author: Tom Tromey <tromey@redhat.com> Date: Wed Jan 25 16:20:30 2012 +0000 * gdb.base/solib-disc.exp: Fix regexps. commit 74ce40a2187959252051f46f9988f1dbec6d6393 Author: Tom Tromey <tromey@redhat.com> Date: Wed Jan 25 15:57:02 2012 +0000 * breakpoint.c (bpstat_stop_status): Check 'breakpoint_at' before dereferencing. commit eb317823c809dd8781672e9d34d5eb663d65153d Author: DJ Delorie <dj@delorie.com> Date: Wed Jan 25 01:40:09 2012 +0000 * rl78-decode.opc (rl78_decode_opcode): Add NOT1. * rl78-decode.c: Regenerate. * config/rl78-parse.y (NOT1): Add. commit 98b6395f8ed8a558c9e8b8d261680d0a95dc6010 Author: gdbadmin <gdbadmin@sourceware.org> Date: Wed Jan 25 00:00:32 2012 +0000 *** empty log message *** commit 098e388b18b0d6e75e916f68f875d8ab4073ef59 Author: Alan Modra <amodra@bigpond.net.au> Date: Tue Jan 24 23:00:06 2012 +0000 daily update commit 23be81b20039c057ad0af30082f6f8a16a7643e9 Author: Tom Tromey <tromey@redhat.com> Date: Tue Jan 24 21:39:14 2012 +0000 PR symtab/12406: * solib.c (update_solib_list): Update the program space's added_solibs and deleted_solibs fields. * progspace.h (struct program_space) <added_solibs, deleted_solibs>: New fields. (clear_program_space_solib_cache): Declare. * progspace.c (release_program_space): Call clear_program_space_solib_cache. (clear_program_space_solib_cache): New function. * infrun.c (handle_inferior_event) <TARGET_WAITKIND_LOADED>: Call bpstat_stop_status. Use handle_solib_event. * breakpoint.c: Include gdb_regex.h. (print_solib_event): New function. (bpstat_print): Use print_solib_event. (bpstat_stop_status): Add special case for bp_shlib_event. (handle_solib_event): New function. (bpstat_what): Use handle_solib_event. (struct solib_catchpoint): New. (dtor_catch_solib, insert_catch_solib, remove_catch_solib) (breakpoint_hit_catch_solib, check_status_catch_solib) (print_it_catch_solib, print_one_catch_solib) (print_mention_catch_solib, print_recreate_catch_solib): New functions. (catch_solib_breakpoint_ops): New global. (catch_load_or_unload, catch_load_command_1) (catch_unload_command_1): New functions. (internal_bkpt_check_status): Add special case for bp_shlib_event. (internal_bkpt_print_it): Use print_solib_event. (initialize_breakpoint_ops): Initialize catch_solib_breakpoint_ops. (_initialize_breakpoint): Register "catch load" and "catch unload". * breakpoint.h (handle_solib_event): Declare. * NEWS: Add entry for "catch load" and "catch unload". gdb/doc * gdb.texinfo (Set Catchpoints): Document "catch load" and "catch unload". (Files): Mention new catch commands. (GDB/MI Async Records): Likewise. gdb/testsuite * lib/mi-support.exp (mi_expect_stop): Add special case for solib-event. * gdb.base/catch-load-so.c: New file. * gdb.base/catch-load.exp: New file. * gdb.base/catch-load.c: New file. * gdb.base/break-interp.exp (reach_1): Update regexp. commit a2127f5b008cc30a6949ac111fb460c1e91650b3 Author: Tom Tromey <tromey@redhat.com> Date: Tue Jan 24 21:36:37 2012 +0000 * ada-lang.c: Include gdb_vecs.h. * charset.c: Include gdb_vecs.h. * tracepoint.h: Include gdb_vecs.h. * gdb_vecs.h: New file. commit 011ad04db6bd4938623a2d3fb1ec95d360db4387 Author: Tom Tromey <tromey@redhat.com> Date: Tue Jan 24 21:32:56 2012 +0000 2012-01-24 Pedro Alves <pedro@codesourcery.com> * breakpoint.c (breakpoint_hit_catch_fork) (breakpoint_hit_catch_vfork, breakpoint_hit_catch_syscall) (breakpoint_hit_catch_exec): Make use of the `ws' argument. * infrun.c (inferior_has_forked, inferior_has_vforked) (inferior_has_execd, inferior_has_called_syscall): Delete. (handle_syscall_event): Get syscall_number from the execution control state's wait status. (wait_for_inferior): Don't clear syscall_number. commit 59d922bc748faf76b7f7477953ae34fe7d043e11 Author: Tom Tromey <tromey@redhat.com> Date: Tue Jan 24 21:31:23 2012 +0000 2012-01-24 Pedro Alves <palves@redhat.com> * breakpoint.c (bpstat_check_location, bpstat_stop_status, pc_at_non_inline_function): Add `ws' parameter, and pass it down. (breakpoint_hit_catch_fork, breakpoint_hit_catch_vfork) (breakpoint_hit_catch_syscall, breakpoint_hit_catch_exec): Add `ws' parameter. (breakpoint_hit_ranged_breakpoint): Add `ws' parameter. Return false for events other than TARGET_SIGNAL_TRAP. (breakpoint_hit_watchpoint, base_breakpoint_breakpoint_hit): Add `ws' parameter. (bkpt_breakpoint_hit): Add `ws' parameter. Return false for events other than TARGET_SIGNAL_TRAP. (tracepoint_breakpoint_hit): Add `ws' parameter. * breakpoint.h (struct breakpoint_ops) <breakpoint_hit>: Add `ws' parameter. (bpstat_stop_status): Same. (pc_at_non_inline_function): Same. * infrun.c (handle_syscall_event, handle_inferior_event): Adjust to pass the current event's waitstatus to bpstat_stop_status and pc_at_non_inline_function. commit 5eb09c030ab6d18adeea75261b148ed325c51cc0 Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Tue Jan 24 20:56:33 2012 +0000 gdb/ Code cleanup. * cli/cli-cmds.c (source_script_from_stream): Never fclose STREAM. Update the function comment for it. (source_script_with_search): Call make_cleanup_fclose for STREAM. * cli/cli-script.c (script_from_file): Do not call make_cleanup_fclose for STREAM. commit ee3529349cce157cbef4833203fd0912a89e9d73 Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Tue Jan 24 20:35:35 2012 +0000 gdb/testsuite/ Fix fuzzy results. * gdb.mi/var-cmd.c (do_locals_tests): Initialize variables lsimple, lpsimple and func. commit 711a646b7940a7b7cc49c31a5a267b0e2371938f Author: Pedro Alves <pedro@codesourcery.com> Date: Tue Jan 24 19:12:31 2012 +0000 2012-01-24 Pedro Alves <palves@redhat.com> * breakpoint.c (bpstat_stop_status): Moving clearing print_it outside `bs->stop' block. (bpstat_what): Rework bp_shlib_event handling. (internal_bkpt_check_status): If the breakpoint is a bp_shlib_event, then set bs->stop and bs->print if stop_on_solib_events is set. commit 55ebf19b5083ffb66350d1111b18bbdc745187fe Author: gary <gary> Date: Tue Jan 24 15:13:26 2012 +0000 ChangeLog: Delete #if 0'd out code. * stack.c (print_frame_label_vars): Remove. (catch_info): Likewise. (_initialize_stack): Remove "info catch" command. * NEWS: Mention the above. doc/ChangeLog: Delete #if 0'd out code. * gdb.texinfo (Frame Info): Remove "info catch". testsuite/ChangeLog: Delete #if 0'd out code. * gdb.base/default.exp (info catch): Remove. * gdb.base/gdb_history (info catch): Likewise. * gdb.base/help.exp (info catch): Likewise. commit 9aac6fcf549f3f5779287df68d4344c1cc0cd352 Author: Pedro Alves <pedro@codesourcery.com> Date: Tue Jan 24 14:19:01 2012 +0000 2012-01-24 Pedro Alves <palves@redhat.com> * remote.c (remote_add_inferior): New `fake_pid_p' parameter. Use it. (remote_notice_new_inferior): If the remote end doesn't support the multiprocess extensions, then the PID is fake. (add_current_inferior_and_thread): New. (remote_start_remote): Use it. (extended_remote_attach_1): Adjust. (extended_remote_create_inferior_1): Use add_current_inferior_and_thread. ----------------------------------------------------------------------- Summary of changes: bfd/ChangeLog | 50 ++ bfd/archive.c | 63 +- bfd/archive64.c | 6 +- bfd/bfdio.c | 3 +- bfd/elf-bfd.h | 24 +- bfd/elf.c | 59 +- bfd/elf32-arm.c | 49 ++ bfd/elf64-ppc.c | 21 +- bfd/elfxx-target.h | 7 +- bfd/libbfd-in.h | 32 +- bfd/libbfd.h | 32 +- bfd/pef.c | 4 + bfd/version.h | 2 +- bfd/xsym.c | 2 + gdb/ChangeLog | 451 ++++++++++ gdb/Makefile.in | 9 - gdb/NEWS | 19 +- gdb/ada-lang.c | 3 +- gdb/amd64-linux-nat.c | 19 +- gdb/breakpoint.c | 544 +++++++++++-- gdb/breakpoint.h | 19 +- gdb/charset.c | 3 +- gdb/cli/cli-cmds.c | 18 +- gdb/cli/cli-script.c | 4 +- gdb/config.in | 21 + gdb/configure | 94 ++- gdb/configure.ac | 61 +- gdb/defs.h | 29 + gdb/doc/ChangeLog | 18 + gdb/doc/gdb.texinfo | 45 +- gdb/gcore.c | 54 +- gdb/{linux-tdep.h => gdb_vecs.h} | 15 +- gdb/gdbarch.c | 99 +++ gdb/gdbarch.h | 24 + gdb/gdbarch.sh | 9 + gdb/gdbserver/ChangeLog | 21 + gdb/gdbserver/hostio.c | 33 + gdb/gdbserver/linux-low.c | 3 +- gdb/gdbserver/server.c | 31 +- gdb/i386-linux-nat.c | 13 +- gdb/i386-nat.c | 164 +++- gdb/inf-child.c | 231 +++++ gdb/infcmd.c | 113 +++ gdb/inferior.c | 1 + gdb/inferior.h | 2 + gdb/infrun.c | 138 +--- gdb/linux-nat.c | 889 +++----------------- gdb/linux-nat.h | 6 + gdb/linux-tdep.c | 657 +++++++++++++++ gdb/linux-tdep.h | 12 + gdb/mdebugread.c | 4 +- gdb/parse.c | 35 + gdb/procfs.c | 33 +- gdb/progspace.c | 17 + gdb/progspace.h | 17 + gdb/record.c | 88 ++- gdb/remote.c | 162 +++- gdb/solib.c | 4 + gdb/stack.c | 87 -- gdb/symfile.c | 159 +++-- gdb/target.c | 364 ++++++++- gdb/target.h | 102 +++- gdb/testsuite/.gdbinit | 1 - gdb/testsuite/ChangeLog | 78 ++ gdb/testsuite/gdb.ada/mi_task_info.exp | 2 +- gdb/testsuite/gdb.base/break-interp.exp | 2 +- gdb/testsuite/gdb.base/call-signal-resume.exp | 4 +- .../gdb.base/catch-load-so.c} | 19 +- .../gdb.base/catch-load.c} | 26 +- gdb/testsuite/gdb.base/catch-load.exp | 120 +++ gdb/testsuite/gdb.base/default.exp | 2 - gdb/testsuite/gdb.base/gdb_history | 1 - gdb/testsuite/gdb.base/help.exp | 2 - gdb/testsuite/gdb.base/info-proc.exp | 29 +- gdb/testsuite/gdb.base/sepdebug.exp | 27 +- gdb/testsuite/gdb.base/solib-disc.exp | 4 +- gdb/testsuite/gdb.java/jprint.exp | 12 +- gdb/testsuite/gdb.java/jprint.java | 9 +- gdb/testsuite/gdb.mi/var-cmd.c | 6 +- .../gdb.multi/watchpoint-multi.c} | 42 +- gdb/testsuite/gdb.multi/watchpoint-multi.exp | 91 ++ gdb/testsuite/gdb.python/py-finish-breakpoint.py | 2 +- gdb/testsuite/gdb.threads/watchpoint-fork-child.c | 129 +++ gdb/testsuite/gdb.threads/watchpoint-fork-mt.c | 174 ++++ gdb/testsuite/gdb.threads/watchpoint-fork-parent.c | 74 ++ gdb/testsuite/gdb.threads/watchpoint-fork-st.c | 61 ++ gdb/testsuite/gdb.threads/watchpoint-fork.exp | 163 ++++ .../gdb.threads/watchpoint-fork.h} | 23 +- gdb/testsuite/lib/mi-support.exp | 2 + gdb/top.c | 24 +- gdb/top.h | 2 +- gdb/tracepoint.h | 3 +- gdb/utils.c | 4 +- gdb/version.in | 2 +- libiberty/ChangeLog | 4 + libiberty/configure | 2 +- opcodes/ChangeLog | 5 + opcodes/rl78-decode.opc | 5 + 98 files changed, 4890 insertions(+), 1564 deletions(-) copy gdb/{linux-tdep.h => gdb_vecs.h} (67%) delete mode 100644 gdb/testsuite/.gdbinit copy gdb/{linux-tdep.h => testsuite/gdb.base/catch-load-so.c} (64%) copy gdb/{linux-tdep.h => testsuite/gdb.base/catch-load.c} (64%) create mode 100644 gdb/testsuite/gdb.base/catch-load.exp copy gdb/{linux-tdep.h => testsuite/gdb.multi/watchpoint-multi.c} (57%) create mode 100644 gdb/testsuite/gdb.multi/watchpoint-multi.exp create mode 100644 gdb/testsuite/gdb.threads/watchpoint-fork-child.c create mode 100644 gdb/testsuite/gdb.threads/watchpoint-fork-mt.c create mode 100644 gdb/testsuite/gdb.threads/watchpoint-fork-parent.c create mode 100644 gdb/testsuite/gdb.threads/watchpoint-fork-st.c create mode 100644 gdb/testsuite/gdb.threads/watchpoint-fork.exp copy gdb/{linux-tdep.h => testsuite/gdb.threads/watchpoint-fork.h} (50%) First 500 lines of diff: diff --git a/bfd/ChangeLog b/bfd/ChangeLog index a0be3dc..23c33a1 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,53 @@ +2012-01-23 Alan Modra <amodra@gmail.com> + + * elf-bfd.h: Formatting. + (struct elf_backend_data): Add "maybe_function_sym". + (_bfd_elf_maybe_function_sym): Declare. + * elfxx-target.h (elf_backend_maybe_function_sym): Define. + (elfNN_bed): Init new field. + * elf.c (elf_find_function): Use maybe_function_sym. + (_bfd_elf_maybe_function_sym): New function. + * elf64-ppc.c (elf_backend_maybe_function_sym): Define. + (ppc64_elf_maybe_function_sym): New function. + +2012-01-20 Francois Gouget <fgouget@codeweavers.com> + + PR binutils/13534 + * archive.c (_bfd_ar_sizepad): New function. Correctly install and + pad the size field in an archive header. + (_bfd_generic_read_ar_hdr_mag): Use the correct type and scan + function for the archive size field. + (bfd_generic_openr_next_archived_file): Likewise. + (do_slurp_coff_armap): Likewise. + (_bfd_write_archive_contents): Likewise. + (_bfd_bsd44_write_ar_hdr): Use the new function. + (bfd_ar_hdr_from_filesystem): Likewise. + (_bfd_write_archive_contents): Likewise. + (bsd_write_armap): Likewise. + (coff_write_armap): Likewise. + * archive64.c (bfd_elf64_archive_write_armap): Likewise. + * bfdio.c (bfd_bread): Use correct type for archive element + sizes. + * ar.c (open_inarch): Likewise. + (extract_file): Likewise. + * libbfd-in.h (struct areltdata): Use correct types for + parsed_size and extra_size fields. + Prototype _bfd_ar_sizepad function. + * libbfd.h: Regenerate. + +2012-01-20 Ulrich Weigand <ulrich.weigand@linaro.org> + + * elf.c (elfcore_write_prpsinfo): Provide unconditionally. + Return NULL if core file generation is unsupported. + (elfcore_write_prstatus): Likewise. + * elf32-arm.c (elf32_arm_nabi_write_core_note): New function. + (elf_backend_write_core_note): Define. + +2012-01-19 Tristan Gingold <gingold@adacore.com> + + * pef.c: Add a comment. + * xsym.c: Likewise. + 2012-01-17 Alan Modra <amodra@gmail.com> * elf32-ppc.c (ppc_elf_write_core_note <NT_PRPSINFO>): Don't leave diff --git a/bfd/archive.c b/bfd/archive.c index ac2be3e..86c62a5 100644 --- a/bfd/archive.c +++ b/bfd/archive.c @@ -1,7 +1,7 @@ /* BFD back-end for archive files (libraries). Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 - Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, + 2012 Free Software Foundation, Inc. Written by Cygnus Support. Mostly Gumby Henkel-Wallace's fault. This file is part of BFD, the Binary File Descriptor library. @@ -178,6 +178,29 @@ _bfd_ar_spacepad (char *p, size_t n, const char *fmt, long val) else memcpy (p, buf, n); } + +bfd_boolean +_bfd_ar_sizepad (char *p, size_t n, bfd_size_type size) +{ + static char buf[21]; + size_t len; + + snprintf (buf, sizeof (buf), "%-10" BFD_VMA_FMT "u", size); + len = strlen (buf); + if (len > n) + { + bfd_set_error (bfd_error_file_too_big); + return FALSE; + } + if (len < n) + { + memcpy (p, buf, len); + memset (p + len, ' ', n - len); + } + else + memcpy (p, buf, n); + return TRUE; +} \f bfd_boolean _bfd_generic_mkarchive (bfd *abfd) @@ -424,7 +447,7 @@ _bfd_generic_read_ar_hdr_mag (bfd *abfd, const char *mag) { struct ar_hdr hdr; char *hdrp = (char *) &hdr; - size_t parsed_size; + bfd_size_type parsed_size; struct areltdata *ared; char *filename = NULL; bfd_size_type namelen = 0; @@ -448,8 +471,7 @@ _bfd_generic_read_ar_hdr_mag (bfd *abfd, const char *mag) } errno = 0; - parsed_size = strtol (hdr.ar_size, NULL, 10); - if (errno != 0) + if (sscanf (hdr.ar_size, "%" BFD_VMA_FMT "u", &parsed_size) != 1) { bfd_set_error (bfd_error_malformed_archive); return NULL; @@ -721,7 +743,7 @@ bfd_generic_openr_next_archived_file (bfd *archive, bfd *last_file) filestart = bfd_ardata (archive)->first_file_filepos; else { - unsigned int size = arelt_size (last_file); + bfd_size_type size = arelt_size (last_file); filestart = last_file->proxy_origin; if (! bfd_is_thin_archive (archive)) @@ -917,7 +939,7 @@ do_slurp_coff_armap (bfd *abfd) struct artdata *ardata = bfd_ardata (abfd); char *stringbase; bfd_size_type stringsize; - unsigned int parsed_size; + bfd_size_type parsed_size; carsym *carsyms; bfd_size_type nsymz; /* Number of symbols in armap. */ bfd_vma (*swap) (const void *); @@ -1762,14 +1784,16 @@ _bfd_bsd44_write_ar_hdr (bfd *archive, bfd *abfd) BFD_ASSERT (padded_len == arch_eltdata (abfd)->extra_size); - _bfd_ar_spacepad (hdr->ar_size, sizeof (hdr->ar_size), "%-10ld", - arch_eltdata (abfd)->parsed_size + padded_len); + if (!_bfd_ar_sizepad (hdr->ar_size, sizeof (hdr->ar_size), + arch_eltdata (abfd)->parsed_size + padded_len)) + return FALSE; if (bfd_bwrite (hdr, sizeof (*hdr), archive) != sizeof (*hdr)) return FALSE; if (bfd_bwrite (fullname, len, archive) != len) return FALSE; + if (len & 3) { static const char pad[3] = { 0, 0, 0 }; @@ -1883,8 +1907,11 @@ bfd_ar_hdr_from_filesystem (bfd *abfd, const char *filename, bfd *member) status.st_gid); _bfd_ar_spacepad (hdr->ar_mode, sizeof (hdr->ar_mode), "%-8lo", status.st_mode); - _bfd_ar_spacepad (hdr->ar_size, sizeof (hdr->ar_size), "%-10ld", - status.st_size); + if (!_bfd_ar_sizepad (hdr->ar_size, sizeof (hdr->ar_size), status.st_size)) + { + free (ared); + return NULL; + } memcpy (hdr->ar_fmag, ARFMAG, 2); ared->parsed_size = status.st_size; ared->arch_header = (char *) hdr; @@ -2124,8 +2151,9 @@ _bfd_write_archive_contents (bfd *arch) memset (&hdr, ' ', sizeof (struct ar_hdr)); memcpy (hdr.ar_name, ename, strlen (ename)); /* Round size up to even number in archive header. */ - _bfd_ar_spacepad (hdr.ar_size, sizeof (hdr.ar_size), "%-10ld", - (elength + 1) & ~(bfd_size_type) 1); + if (!_bfd_ar_sizepad (hdr.ar_size, sizeof (hdr.ar_size), + (elength + 1) & ~(bfd_size_type) 1)) + return FALSE; memcpy (hdr.ar_fmag, ARFMAG, 2); if ((bfd_bwrite (&hdr, sizeof (struct ar_hdr), arch) != sizeof (struct ar_hdr)) @@ -2143,7 +2171,7 @@ _bfd_write_archive_contents (bfd *arch) current = current->archive_next) { char buffer[DEFAULT_BUFFERSIZE]; - unsigned int remaining = arelt_size (current); + bfd_size_type remaining = arelt_size (current); /* Write ar header. */ if (!_bfd_write_ar_hdr (arch, current)) @@ -2401,7 +2429,8 @@ bsd_write_armap (bfd *arch, bfd_ardata (arch)->armap_timestamp); _bfd_ar_spacepad (hdr.ar_uid, sizeof (hdr.ar_uid), "%ld", uid); _bfd_ar_spacepad (hdr.ar_gid, sizeof (hdr.ar_gid), "%ld", gid); - _bfd_ar_spacepad (hdr.ar_size, sizeof (hdr.ar_size), "%-10ld", mapsize); + if (!_bfd_ar_sizepad (hdr.ar_size, sizeof (hdr.ar_size), mapsize)) + return FALSE; memcpy (hdr.ar_fmag, ARFMAG, 2); if (bfd_bwrite (&hdr, sizeof (struct ar_hdr), arch) != sizeof (struct ar_hdr)) @@ -2556,8 +2585,8 @@ coff_write_armap (bfd *arch, memset (&hdr, ' ', sizeof (struct ar_hdr)); hdr.ar_name[0] = '/'; - _bfd_ar_spacepad (hdr.ar_size, sizeof (hdr.ar_size), "%-10ld", - mapsize); + if (!_bfd_ar_sizepad (hdr.ar_size, sizeof (hdr.ar_size), mapsize)) + return FALSE; _bfd_ar_spacepad (hdr.ar_date, sizeof (hdr.ar_date), "%ld", ((arch->flags & BFD_DETERMINISTIC_OUTPUT) == 0 ? time (NULL) : 0)); diff --git a/bfd/archive64.c b/bfd/archive64.c index bbc4c3f..f3a13d3 100644 --- a/bfd/archive64.c +++ b/bfd/archive64.c @@ -1,6 +1,6 @@ /* MIPS-specific support for 64-bit ELF Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, - 2010 Free Software Foundation, Inc. + 2010, 2012 Free Software Foundation, Inc. Ian Lance Taylor, Cygnus Support Linker support added by Mark Mitchell, CodeSourcery, LLC. <mark@codesourcery.com> @@ -169,8 +169,8 @@ bfd_elf64_archive_write_armap (bfd *arch, memset (&hdr, ' ', sizeof (struct ar_hdr)); memcpy (hdr.ar_name, "/SYM64/", strlen ("/SYM64/")); - _bfd_ar_spacepad (hdr.ar_size, sizeof (hdr.ar_size), "%-10ld", - mapsize); + if (!_bfd_ar_sizepad (hdr.ar_size, sizeof (hdr.ar_size), mapsize)) + return FALSE; _bfd_ar_spacepad (hdr.ar_date, sizeof (hdr.ar_date), "%ld", time (NULL)); /* This, at least, is what Intel coff sets the values to.: */ diff --git a/bfd/bfdio.c b/bfd/bfdio.c index c142c17..6f8a7c9 100644 --- a/bfd/bfdio.c +++ b/bfd/bfdio.c @@ -185,7 +185,8 @@ bfd_bread (void *ptr, bfd_size_type size, bfd *abfd) this element. */ if (abfd->arelt_data != NULL) { - size_t maxbytes = arelt_size (abfd); + bfd_size_type maxbytes = arelt_size (abfd); + if (abfd->where + size > maxbytes) { if (abfd->where >= maxbytes) diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index c7846e1..98948a9 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1,6 +1,6 @@ /* BFD back-end data structures for ELF files. Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. Written by Cygnus Support. @@ -1221,6 +1221,11 @@ struct elf_backend_data /* Return TRUE if type is a function symbol type. */ bfd_boolean (*is_function_type) (unsigned int type); + /* Return TRUE if symbol may be a function. Set *CODE_SEC and *CODE_VAL + to the function's entry point. */ + bfd_boolean (*maybe_function_sym) (const elf_symbol_type *sym, + asection **code_sec, bfd_vma *code_off); + /* Used to handle bad SHF_LINK_ORDER input. */ bfd_error_handler_type link_order_error_handler; @@ -1413,14 +1418,14 @@ struct bfd_elf_section_data void *sec_info; }; -#define elf_section_data(sec) ((struct bfd_elf_section_data*)(sec)->used_by_bfd) +#define elf_section_data(sec) ((struct bfd_elf_section_data*)(sec)->used_by_bfd) #define elf_linked_to_section(sec) (elf_section_data(sec)->linked_to) -#define elf_section_type(sec) (elf_section_data(sec)->this_hdr.sh_type) -#define elf_section_flags(sec) (elf_section_data(sec)->this_hdr.sh_flags) -#define elf_group_name(sec) (elf_section_data(sec)->group.name) -#define elf_group_id(sec) (elf_section_data(sec)->group.id) -#define elf_next_in_group(sec) (elf_section_data(sec)->next_in_group) -#define elf_fde_list(sec) (elf_section_data(sec)->fde_list) +#define elf_section_type(sec) (elf_section_data(sec)->this_hdr.sh_type) +#define elf_section_flags(sec) (elf_section_data(sec)->this_hdr.sh_flags) +#define elf_group_name(sec) (elf_section_data(sec)->group.name) +#define elf_group_id(sec) (elf_section_data(sec)->group.id) +#define elf_next_in_group(sec) (elf_section_data(sec)->next_in_group) +#define elf_fde_list(sec) (elf_section_data(sec)->fde_list) #define elf_sec_group(sec) (elf_section_data(sec)->sec_group) #define xvec_get_elf_backend_data(xvec) \ @@ -2197,6 +2202,9 @@ extern bfd_boolean _bfd_elf_map_sections_to_segments extern bfd_boolean _bfd_elf_is_function_type (unsigned int); +extern bfd_boolean _bfd_elf_maybe_function_sym (const elf_symbol_type *, + asection **, bfd_vma *); + extern int bfd_elf_get_default_section_type (flagword); extern void bfd_elf_lookup_section_flags diff --git a/bfd/elf.c b/bfd/elf.c index bafb3bb..9c9ba75 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -1,7 +1,7 @@ /* ELF executable support for BFD. Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -7406,6 +7406,8 @@ elf_find_function (bfd *abfd, { elf_symbol_type *q; unsigned int type; + asection *code_sec; + bfd_vma code_off; q = (elf_symbol_type *) *p; @@ -7418,15 +7420,13 @@ elf_find_function (bfd *abfd, state = file_after_symbol_seen; continue; default: - if (!bed->is_function_type (type)) - break; - case STT_NOTYPE: - if (bfd_get_section (&q->symbol) == section - && q->symbol.value >= low_func - && q->symbol.value <= offset) + if (bed->maybe_function_sym (q, &code_sec, &code_off) + && code_sec == section + && code_off >= low_func + && code_off <= offset) { func = (asymbol *) q; - low_func = q->symbol.value; + low_func = code_off; filename = NULL; if (file != NULL && (ELF_ST_BIND (q->internal_elf_sym.st_info) == STB_LOCAL @@ -8890,7 +8890,6 @@ elfcore_write_note (bfd *abfd, return buf; } -#if defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T) char * elfcore_write_prpsinfo (bfd *abfd, char *buf, @@ -8898,7 +8897,6 @@ elfcore_write_prpsinfo (bfd *abfd, const char *fname, const char *psargs) { - const char *note_name = "CORE"; const struct elf_backend_data *bed = get_elf_backend_data (abfd); if (bed->elf_backend_write_core_note != NULL) @@ -8910,6 +8908,7 @@ elfcore_write_prpsinfo (bfd *abfd, return ret; } +#if defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T) #if defined (HAVE_PRPSINFO32_T) || defined (HAVE_PSINFO32_T) if (bed->s->elfclass == ELFCLASS32) { @@ -8925,7 +8924,7 @@ elfcore_write_prpsinfo (bfd *abfd, strncpy (data.pr_fname, fname, sizeof (data.pr_fname)); strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs)); return elfcore_write_note (abfd, buf, bufsiz, - note_name, note_type, &data, sizeof (data)); + "CORE", note_type, &data, sizeof (data)); } else #endif @@ -8942,12 +8941,14 @@ elfcore_write_prpsinfo (bfd *abfd, strncpy (data.pr_fname, fname, sizeof (data.pr_fname)); strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs)); return elfcore_write_note (abfd, buf, bufsiz, - note_name, note_type, &data, sizeof (data)); + "CORE", note_type, &data, sizeof (data)); } -} #endif /* PSINFO_T or PRPSINFO_T */ -#if defined (HAVE_PRSTATUS_T) + free (buf); + return NULL; +} + char * elfcore_write_prstatus (bfd *abfd, char *buf, @@ -8956,7 +8957,6 @@ elfcore_write_prstatus (bfd *abfd, int cursig, const void *gregs) { - const char *note_name = "CORE"; const struct elf_backend_data *bed = get_elf_backend_data (abfd); if (bed->elf_backend_write_core_note != NULL) @@ -8969,6 +8969,7 @@ elfcore_write_prstatus (bfd *abfd, return ret; } +#if defined (HAVE_PRSTATUS_T) #if defined (HAVE_PRSTATUS32_T) if (bed->s->elfclass == ELFCLASS32) { @@ -8978,7 +8979,7 @@ elfcore_write_prstatus (bfd *abfd, prstat.pr_pid = pid; prstat.pr_cursig = cursig; memcpy (&prstat.pr_reg, gregs, sizeof (prstat.pr_reg)); - return elfcore_write_note (abfd, buf, bufsiz, note_name, + return elfcore_write_note (abfd, buf, bufsiz, "CORE", NT_PRSTATUS, &prstat, sizeof (prstat)); } else @@ -8990,12 +8991,15 @@ elfcore_write_prstatus (bfd *abfd, prstat.pr_pid = pid; prstat.pr_cursig = cursig; memcpy (&prstat.pr_reg, gregs, sizeof (prstat.pr_reg)); - return elfcore_write_note (abfd, buf, bufsiz, note_name, + return elfcore_write_note (abfd, buf, bufsiz, "CORE", NT_PRSTATUS, &prstat, sizeof (prstat)); } -} #endif /* HAVE_PRSTATUS_T */ + free (buf); + return NULL; +} + #if defined (HAVE_LWPSTATUS_T) char * elfcore_write_lwpstatus (bfd *abfd, @@ -9686,3 +9690,22 @@ _bfd_elf_is_function_type (unsigned int type) return (type == STT_FUNC || type == STT_GNU_IFUNC); } + +/* Return TRUE iff the ELF symbol SYM might be a function. Set *CODE_SEC + and *CODE_OFF to the function's entry point. */ + +bfd_boolean +_bfd_elf_maybe_function_sym (const elf_symbol_type *sym, + asection **code_sec, bfd_vma *code_off) +{ + unsigned int type = ELF_ST_TYPE (sym->internal_elf_sym.st_info); + if (type == STT_NOTYPE + || type == STT_FUNC + || type == STT_GNU_IFUNC) + { + *code_sec = sym->symbol.section; + *code_off = sym->symbol.value; + return TRUE; + } + return FALSE; +} diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 31ea861..62a0b8d 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -1988,6 +1988,54 @@ elf32_arm_nabi_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) return TRUE; } +static char * +elf32_arm_nabi_write_core_note (bfd *abfd, char *buf, int *bufsiz, + int note_type, ...) +{ + switch (note_type) + { + default: + return NULL; + + case NT_PRPSINFO: + { + char data[124]; + va_list ap; + + va_start (ap, note_type); + memset (data, 0, sizeof (data)); + strncpy (data + 28, va_arg (ap, const char *), 16); + strncpy (data + 44, va_arg (ap, const char *), 80); + va_end (ap); + + return elfcore_write_note (abfd, buf, bufsiz, + "CORE", note_type, data, sizeof (data)); + } + + case NT_PRSTATUS: hooks/post-receive -- Repository for Project Archer.
next reply other threads:[~2012-01-25 18:44 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-01-25 18:44 sergiodj [this message] -- strict thread matches above, loose matches on Subject: below -- 2012-02-27 17:54 sergiodj 2012-01-26 21:12 sergiodj 2012-01-18 3:20 sergiodj 2011-03-28 16:22 jkratoch 2011-03-20 13:35 jkratoch
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=20120125184356.18336.qmail@sourceware.org \ --to=sergiodj@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: linkBe 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).