From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7895 invoked by alias); 6 Jun 2012 10:42:56 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 7741 invoked by uid 9514); 6 Jun 2012 10:42:52 -0000 Date: Wed, 06 Jun 2012 10:42:00 -0000 Message-ID: <20120606104252.7726.qmail@sourceware.org> From: pmuldoon@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-pmuldoon-python-backtrace: Merge remote-tracking branch 'gdb/master' into archer-pmuldoon-python-backtrace X-Git-Refname: refs/heads/archer-pmuldoon-python-backtrace X-Git-Reftype: branch X-Git-Oldrev: 910c18a8c454bc4a0389af80b021ea658f14ed01 X-Git-Newrev: 564a66e215d4e982691c0b6e8eae5576ca229df6 X-SW-Source: 2012-q2/txt/msg00044.txt.bz2 List-Id: The branch, archer-pmuldoon-python-backtrace has been updated via 564a66e215d4e982691c0b6e8eae5576ca229df6 (commit) via 0cdbe919af3ec246b66fab0af95b758bdbcedd0d (commit) via 2b3c1e3ccaa5e570c3e19693f101fdd56c105fa2 (commit) via da29b59a113416c2a7bf83859ff1e93bb529814a (commit) via 5356af6006fd1042deceb2a532ffe31d11ce6d69 (commit) via 13dd90fe16074ec98f86ee82e883b47481442fd5 (commit) via d7fbc9fc027f2877eab9215ffaf7a10f3d09966a (commit) via ac57ded42ec6953b7ff233fa6d9b10ff34802d7b (commit) via 5c0227adec1a2211941a61c7bbf7a3d47c959917 (commit) via 04015e0e5bce10e3ffea7ae908f84fa9756a80f4 (commit) via eb66428525fe72349a09aad4cca20fc164580cd3 (commit) via 0ae0a2fb9af480e6aa7e97c4de5ab46769d09dad (commit) via 93b04acbcaf785b8e106ff60112488d77d8fb437 (commit) via 2d1e5b27e136de4a5ed04e36b943e0676fa05ad2 (commit) via c8c5621e862a8a7bdc312066bdc71fd67e91a9e2 (commit) via 6624a4698fbcd343e56a6505c1e384d8a3f6a39c (commit) via e8fb524526506e0b39270b05e73fbc98dd5c4572 (commit) via 2b2d829f3fb378c643d4d15cc8ce619295993eba (commit) via f1d1c675107edf9321889033f824c07dda581a84 (commit) via 96d3d3b9c7ccf6c64932fffaf0f5f1ae093492a6 (commit) via c5ef18a4aa07d88a3a8100a78b5e82abc7d84fae (commit) via fd5c41596fe76fd356843acba8776fd8a3b77d18 (commit) via 784eeb9ca992bfd5833b1bde805dfef6a4d8c31c (commit) via 77c735d2fda76f80bc420f129c1cd948ba1c33f3 (commit) via ac069b39d14e44b13ada764698e036d88bdeba30 (commit) via 98650f4f12f05f3cf86b4cdad56c6f4e99ca7d20 (commit) via 47c4f68c6bbe2cb4bd8db38e20b956a75607aa60 (commit) via 0680fbcee0a8b361b3d6350502c538418e9b9d55 (commit) via a29f40b662a2626f877d7e9ca485af6c56959c35 (commit) via bc5feec2c1dd5ab0c8a51cd31b3ac5d57ae9ac74 (commit) via dd3e83238802b09fada91b3987ee69a32a11d73b (commit) via ad064eb42448f46eda90bd9a470916ce594534d4 (commit) via b3d1fe6202986451e4e03f3a13fb2f3274a2162a (commit) via 6c7a701167748298ea55035e772a6cfe5f58f015 (commit) via df437be06b28736c584a33c81028d740ea7e84f4 (commit) via 57b13094ffda1a3ee5055637b36b7871b86b41e8 (commit) via 945eb2562c507a126391cf5863b53efe89e67f2c (commit) via 6b8f70451df78dc3c7b85de4ff85f6b4faebf500 (commit) via b999d4a7b8054829705ba33a7890ccae02dc3d97 (commit) via 7bbe7c5c7271cbfd383c5019444e42aef7fd6b7b (commit) via 47ac50f70225b9f04fb26968215eba8046e83923 (commit) via d43ca3bfc165c72be20288233d20d61ec107a2de (commit) via f872240a59c8977b431a55d843652b833b5afbf2 (commit) via f21a91e2e7d637cceb019d7033be36474ecf9690 (commit) via 4d26671f35fa1c8cafe33085d441bda77030a98f (commit) via 6a3c6fb8947eed79736466d7513d9b56a41c2eea (commit) via 19b593adb11b816a92683e63f53d7a53f9790ffe (commit) via 2f7e83a2d2d70aa59b39d63eb1ca10814222d395 (commit) via 4c64c1e28d931293e76f2c8feb88c83daa980ade (commit) via 9c97af57fe0799b06cbb708b89cc04210949b787 (commit) via 8c34d256e9201b6742db6739457d710c69ad9383 (commit) via 695f8467fea32275183d91e300ea28f34fa0478d (commit) via 1d219f208138967443906dbf698c3049a8275fe5 (commit) via 568b16431706019c04b33096767dec3410d6d7cb (commit) via 7c36b712b439f7e8ac11b614f35be0c0e380d7f4 (commit) via 73c25eebc759e8161628f457689b754ca2904331 (commit) via 5cdaddc48ecf97b951309c485120925480f1ece4 (commit) via 148e195aa41f2ed6b37a2ca7ba55f42348817d49 (commit) via 0968c330f483a5211a53a9602164187ec3b24233 (commit) via bbb5d9094ffc3788a9a3a4d31dcd0ae33b79d29e (commit) via b9c7b97b511592c4bf603e0d78476cd611278f9f (commit) via d866253493b51b6f1a79551587b908d05d4c477e (commit) via 7fa0f5962846707b14575a84ed3898f961ed6254 (commit) via c4e6c4dbda51f01845052bd6829afd217a59fcca (commit) via 269a7136202a6bbf8a73aa59739262e3eb4a1531 (commit) via 07006503e6801f75aca9949f302cff006ef8b4a7 (commit) via 4b26898bfc8478ba704216dbad99595b1c3d6bb8 (commit) via b30e75e42ceaf4cfeb92d23aaa4a660875ddf9f6 (commit) via 881a2ab49196f17b674368fc05321090f11ed685 (commit) via 89292258ba29b3e05245cc822e850a7a3006fa36 (commit) via 33abb58da73eb632c67b11bb0fab49692abee35a (commit) via 407a6427aa4bc30235a3165e013b9972f400492d (commit) via 52c56361047cb7f177be1830af2d65af2ea3b86f (commit) via c171e79c15c6c9ff323982f061824ed0df095560 (commit) via 6977f2ef67d89be790b663facaed9fe32b0b70e4 (commit) via 1813d6d9ba67ef93f49436b1374f80a8982ff751 (commit) via 553cca91744d2cdd3a2c695a879726977b8f9889 (commit) via e00c707600b809c4af9dca0fdaadc0cac47d1940 (commit) via 0f54d59346f265f6cc1e3d396f12745e363373ec (commit) via ad1541928e78df185d1fb979629b4fe9df13d7b8 (commit) via 53d506157a6d281ba095ff9922492b9793264ad7 (commit) via 0d9094b013e5e8c95658ff1dcc3c964d7243e722 (commit) via f466ba633ec400eaa1855677dde63e52823331b4 (commit) via c4fddfaca8b4d16aeaa508c870994476a52fe641 (commit) via b18a4f31d69e80783efc98ef4430fca6c3643ff3 (commit) via 5e3c3245be667528076da971805e30cfa86252a0 (commit) via 906c2dc64fa6eeb6723219a58495036be6ba18c6 (commit) via 7189cc1aaca27137d2ce6e4a01d423a0e97853cb (commit) via ec596ab17ed5ced021c0238504305bf96790efc1 (commit) via dc3b254cf2a8a11737d922e2139e5632672b3b69 (commit) via c8ba4a93b89a1597f64db761da0928c6c6b39e90 (commit) via 63d7249aa7a16550c565c62ddbfacab395197710 (commit) via 102d2347126506c25dc884a8417985e4fd5705c6 (commit) via 12301e322311d7bfa9130cb3baf6624e65cdf2e2 (commit) via e58e2867d346f6cd81ededb329b0723066844399 (commit) via 2564af7160bd419a20957a790a772dd1eff1d257 (commit) via 0854762a3e2250b044c2cd9696086e80d4fe6467 (commit) via fd307944a2a16a2f927a0d58efc352b2e41d5aae (commit) via bd5f8d0b26287533488d7d488a3f1a369785fc36 (commit) via 4f3c65c16ae39c7400b0dab19d5b0fed902280fe (commit) via c6c4841eafa71408ae9c8807db7179df9be5bf70 (commit) via 69ee219cfaf73ba4b2edc6d8b977c5ab83fca0d2 (commit) via 01db14bdd7d1f66e29059c0b27015de694e33906 (commit) via eb9a618775e2c7f36570402e0ee604304e3d7d4a (commit) via ba0f5eecc1e66757c7b2c4210f195c91bb2cf8fd (commit) via 341cc1174ef74fb15c7ecc09ca3fc44cca81f77e (commit) via 3eae76fab84beaecd1334d480a55fd20f6d138c0 (commit) via a846c7e1faadf34e404eb9789d6ecf848516d737 (commit) via da3d5ed1ebdcc72fdbf09ce10a15e9da9f47d2ae (commit) via aac635059d83739f745e26c4b8aa05302fc34f0f (commit) via de0beaf50e1d02f6c31ff7e74513635efaefbfde (commit) via dab3af53ef688d1c5f5062fddc18798142234285 (commit) via 90066823e715fc55b421600912ca18ff4f3680cc (commit) via 9a1b5b2e4da9e7fa99425ef52b4ca1b186f1357e (commit) via 882f3dd4b9b28f8ba53e9a897c3298602326daef (commit) via 86a6d3fd8633674aac2c8411722a8955b3e14d75 (commit) from 910c18a8c454bc4a0389af80b021ea658f14ed01 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 564a66e215d4e982691c0b6e8eae5576ca229df6 Merge: 910c18a 0cdbe91 Author: Phil Muldoon Date: Wed Jun 6 11:42:18 2012 +0100 Merge remote-tracking branch 'gdb/master' into archer-pmuldoon-python-backtrace commit 0cdbe919af3ec246b66fab0af95b758bdbcedd0d Author: qiyao Date: Wed Jun 6 08:51:22 2012 +0000 gdb/testsuite/ * gdb.base/dprintf.c (main): Add extra parameter when calling printf and fprintf. (bar): New function. It is a dead function, but to ensure 'malloc' is linked explicitly. commit 2b3c1e3ccaa5e570c3e19693f101fdd56c105fa2 Author: qiyao Date: Wed Jun 6 08:47:03 2012 +0000 gdb/testsuite/ * gdb.base/info-proc.exp: Return if target doesn't support 'info proc'. commit da29b59a113416c2a7bf83859ff1e93bb529814a Author: qiyao Date: Wed Jun 6 08:31:31 2012 +0000 gdb/gdbserver/ * ax.c (gdb_eval_agent_expr): Print `top' in hex. commit 5356af6006fd1042deceb2a532ffe31d11ce6d69 Author: qiyao Date: Wed Jun 6 08:20:10 2012 +0000 gdb/doc/ * gdb.texinfo: Update copyright year. commit 13dd90fe16074ec98f86ee82e883b47481442fd5 Author: Stan Shebs Date: Wed Jun 6 06:04:42 2012 +0000 * mi/mi-interp.c (mi_interpreter_init): Set raw_stdout from gdb_stdout. commit d7fbc9fc027f2877eab9215ffaf7a10f3d09966a Author: gdbadmin Date: Wed Jun 6 00:00:32 2012 +0000 *** empty log message *** commit ac57ded42ec6953b7ff233fa6d9b10ff34802d7b Author: Alan Modra Date: Wed Jun 6 00:00:05 2012 +0000 daily update commit 5c0227adec1a2211941a61c7bbf7a3d47c959917 Author: Jan Kratochvil Date: Tue Jun 5 21:22:30 2012 +0000 gdb/ * corefile.c (read_memory, read_stack, write_memory): Accept LEN argument as ssize_t. * gdbcore.h (read_memory, read_stack, write_memory): Likewise. * remote.c (remote_write_bytes_aux, remote_write_bytes): Likewise. * target.c (target_read_stack, target_write_memory) (target_write_raw_memory): Likewise. * target.h (target_read_stack, target_write_memory) (target_write_raw_memory): Likewise. commit 04015e0e5bce10e3ffea7ae908f84fa9756a80f4 Author: Jan Kratochvil Date: Tue Jun 5 21:18:04 2012 +0000 gdb/ * symfile-mem.c: Change gdb_static_assert to ssize_t. (target_read_memory_bfd): Cast gdb_assert LEN to ssize_t. * target.c (target_read_memory): Change LEN to ssize_t. * target.h (target_read_memory): Change LEN to ssize_t. commit eb66428525fe72349a09aad4cca20fc164580cd3 Author: Pedro Alves Date: Tue Jun 5 19:50:48 2012 +0000 2012-06-05 Pedro Alves PR backtrace/13866 * breakpoint.c (until_break_command): Only fetch the selected frame after decode_line_1. commit 0ae0a2fb9af480e6aa7e97c4de5ab46769d09dad Author: Jan Kratochvil Date: Tue Jun 5 19:06:20 2012 +0000 gdb/testsuite/ * gdb.base/freebpcmd.exp (set lines): Check valid range of I. (run program with breakpoint commands): XFAIl if it is not. commit 93b04acbcaf785b8e106ff60112488d77d8fb437 Author: Pedro Alves Date: Tue Jun 5 15:43:58 2012 +0000 2012-06-05 Joakim Tjernlund * solib-svr4.c (enable_break): Don't fallback to setting the solib event breakpoint at _start, __start or main if a program interpreter is not found. commit 2d1e5b27e136de4a5ed04e36b943e0676fa05ad2 Author: Joel Brobecker Date: Tue Jun 5 13:50:57 2012 +0000 Windows-specific iterate_over_objfiles_in_search_order This patch sets the windows target to use their own version of the iterate_over_objfiles_in_search_order gdbarch method, in order to make global symbol searches sensitive to the current objfile. gdb/ChangeLog: * windows-tdep.h (windows_iterate_over_objfiles_in_search_order): Add declaration. * windows-tdep.c: #include "objfiles.h". (windows_iterate_over_objfiles_in_search_order): New function. * amd64-windows-tdep.c (amd64_windows_init_abi): Set iterate_over_objfiles_in_search_order gdbarch method to windows_iterate_over_objfiles_in_search_order. * i386-cygwin-tdep.c (i386_cygwin_init_abi): Likewise. commit c8c5621e862a8a7bdc312066bdc71fd67e91a9e2 Author: Joel Brobecker Date: Tue Jun 5 13:50:49 2012 +0000 New "iterate_over_objfiles_in_search_order" gdbarch method. This patch introduces the "iterate_over_objfiles_in_search_order" gdbarch method, as well as its default implementation, and converts the areas where it will matter to using this gdbarch method. The default method implementation is the only one installed, and the changes should have no functional impact in terms of behavior. This only paves the way for the architectures that will need their own version. gdb/ChangeLog: * gdbarch.sh: Add generation of "iterate_over_objfiles_in_search_order_cb_ftype" typedef in gdbarch.h. Add include of "objfiles.h" in gdbarch.c. (iterate_over_objfiles_in_search_order): New gdbarch method. * gdbarch.h, gdbarch.c: Regenerate. * objfiles.h (default_iterate_over_objfiles_in_search_order): Add declaration. * objfiles.c (default_iterate_over_objfiles_in_search_order): New function. * symtab.c (lookup_symbol_aux_objfile): New function, extracted out of lookup_symbol_aux_symtabs. (lookup_symbol_aux_symtabs): Replace extracted-out code by call to lookup_symbol_aux_objfile. (struct global_sym_lookup_data): New type. (lookup_symbol_global_iterator_cb): New function. (lookup_symbol_global): Search for symbol using gdbarch_iterate_over_objfiles_in_search_order and lookup_symbol_global_iterator_cb. * findvar.c (struct minsym_lookup_data): New type. (minsym_lookup_iterator_cb): New function. (default_read_var_value) [case LOC_UNRESOLVED]: Resolve the symbol's address via gdbarch_iterate_over_objfiles_in_search_order and minsym_lookup_iterator_cb. commit 6624a4698fbcd343e56a6505c1e384d8a3f6a39c Author: Joel Brobecker Date: Tue Jun 5 13:50:39 2012 +0000 Revert "Search global symbols from the expression's block objfile first." The search order used in this patch breaks global symbol lookups for certain symbols when copy-relocation is used. A slightly different search order will be implemented later. gdb/ChangeLog: Revert the following patch: * findvar.c (default_read_var_value): For LOC_UNRESOLVED symbols, try locating the symbol in the symbol's own objfile first, before extending the search to all objfiles. * symtab.c (lookup_symbol_aux_objfile): New function, extracted out of lookup_symbol_aux_symtabs. (lookup_symbol_aux_symtabs): Add new parameter "exclude_objfile". Replace extracted-out code by call to lookup_symbol_aux_objfile. Do not search EXCLUDE_OBJFILE. (lookup_static_symbol_aux): Update call to lookup_symbol_aux_symtabs. (lookup_symbol_global): Search for matches in the block's objfile first, before searching all other objfiles. commit e8fb524526506e0b39270b05e73fbc98dd5c4572 Author: Joel Brobecker Date: Tue Jun 5 13:50:31 2012 +0000 Make ctxobj.exp and print-file-var.exp work on all platforms. This patch adjusts the testing strategy used in a couple of testcases where we are trying to print the value of a global variable defined at multiple locations. The problem is that the actual value depends on the platform. So instead of hard-coding the expected value in the testcase script, we use local variables (in the inferior) holding the correct value, and we compare the global variable's value with the local variable's value. gdb/testsuite/ChangeLog: * gdb.base/ctxobj-f.c (GET_VERSION): Introduce local variable and add comment. * gdb.base/ctxobj-m.c (main): Rewrite, and add comment. * gdb.base/ctxobj.exp: Insert breakpoint in ctxobj-f.c using "STOP" marker. Adjust testing strategy to make it work on all targets. * gdb.base/print-file-var-main.c (main): Rewrite using local variables and adjust get_version_2's return value check. Add small comment. * gdb.base/print-file-var.exp: Insert breakpoint using "STOP" marker. Adjust testing strategy to make it work on all targets. commit 2b2d829f3fb378c643d4d15cc8ce619295993eba Author: Joel Brobecker Date: Tue Jun 5 13:50:11 2012 +0000 stop parsing breakpoint command if invalid keyword found With an Ada program, trying to break on a specific Ada task, but with the wrong capitalization of the `task' keyword, we currently get only pieces of the "garbage" that caused the error: (gdb) b *rendez_vous'address TASK 2 Garbage 2 at end of command Pushing this a little further: (gdb) b *rendez_vous'address TASK Task TaSK 2 Garbage 2 at end of command Another interesting failure mode: (gdb) b *rendez_vous'address TASK if Argument required (expression to compute). The parser skipped `TASK', then found the `if' keyword, and thus started looking for a condition. This patch fixes the problem by aborting the parsing as soon as an invalid keyword is found. This makes it consistent with the case where the REST parameter is passed as NULL (where an error is raised immediately after seeing the first invalid keyword). It also introduces a new testcase that reproduces all above scenarios. gdb/ChangeLog: * breakpoint.c (find_condition_and_thread): Stop parsing as soon as the first invalid keyword is found. gdb/testsuite/ChangeLog: * gdb.ada/bad-task-bp-keyword: New testcase. commit f1d1c675107edf9321889033f824c07dda581a84 Author: Joel Brobecker Date: Tue Jun 5 13:29:29 2012 +0000 copyright.py: Add gdb/CONTRIBUTE to EXCLUDE_LIST. Normally, all files should have a copyright header, but gdb/CONTRIBUTE currently doesn't, and it adding one at the top of the file would probably be more pollution than information. So don't require a copyright header for now. gdb/ChangeLog: * copyright.py (EXCLUDE_LIST): Add 'gdb/CONTRIBUTE' to list. commit 96d3d3b9c7ccf6c64932fffaf0f5f1ae093492a6 Author: Joel Brobecker Date: Tue Jun 5 13:29:21 2012 +0000 Add copyright header to config/djgpp/djcheck.sh. gdb/ChangeLog: * config/djgpp/djcheck.sh: Add copyright header. commit c5ef18a4aa07d88a3a8100a78b5e82abc7d84fae Author: Joel Brobecker Date: Tue Jun 5 13:29:14 2012 +0000 stubs/ia64vms-stub.c: Fix copyright header. There is an extra coma after the copyright year which tricks gnulib's update-copyright script. gdb/stubs/ChangeLog: * ia64vms-stub.c: Adjust copyright header to follow convention expected by gnulib's update-copyright script. commit fd5c41596fe76fd356843acba8776fd8a3b77d18 Author: Joel Brobecker Date: Tue Jun 5 13:29:07 2012 +0000 copyright.py: Update path to gnulib import. The location where we store the gnulib import has changed. This patch updates accordingly the path to gnulib's update-copyright script. gdb/ChangeLog: * copyright.py (update_files, main): Fix path to update-copyright script. commit 784eeb9ca992bfd5833b1bde805dfef6a4d8c31c Author: Joel Brobecker Date: Tue Jun 5 13:28:57 2012 +0000 copyright.py: Tell user to update gdb.texinfo and refcard.tex by hand. gdb/ChangeLog: * copyright.py (MULTIPLE_COPYRIGHT_HEADERS): New constant. (main): Add MULTIPLE_COPYRIGHT_HEADERS to the list of files for which a reminder to update by hand is printed. commit 77c735d2fda76f80bc420f129c1cd948ba1c33f3 Author: Doug Evans Date: Tue Jun 5 01:17:54 2012 +0000 * buildsym.c (make_blockvector): Add comment. commit ac069b39d14e44b13ada764698e036d88bdeba30 Author: gdbadmin Date: Tue Jun 5 00:00:33 2012 +0000 *** empty log message *** commit 98650f4f12f05f3cf86b4cdad56c6f4e99ca7d20 Author: Alan Modra Date: Tue Jun 5 00:00:04 2012 +0000 daily update commit 47c4f68c6bbe2cb4bd8db38e20b956a75607aa60 Author: Pedro Alves Date: Mon Jun 4 16:23:54 2012 +0000 2012-06-04 Pedro Alves * arch-utils.c (default_gdb_signal_from_target): Delete. * arch-utils.h (default_gdb_signal_from_target): Delete. * corelow.c (core_open) : Extended comment. Check gdbarch_gdb_signal_from_target_p. * gdbarch.sh (gdb_signal_from_target): Make it an M method (with predicate). * gdbarch.h: Regenerate. * gdbarch.c: Regenerate. commit 0680fbcee0a8b361b3d6350502c538418e9b9d55 Author: Pedro Alves Date: Mon Jun 4 16:23:11 2012 +0000 2012-06-04 Pedro Alves * gdbarch.sh (gdb_signal_from_target): Mention that the implementation of the method must be host independent. * gdbarch.h: Regenerate. commit a29f40b662a2626f877d7e9ca485af6c56959c35 Author: Jan Kratochvil Date: Mon Jun 4 14:35:18 2012 +0000 bfd/ * bfd-in.h (bfd_elf_bfd_from_remote_memory): Make LEN argument of target_read_memory as bfd_size_type. * bfd-in2.h: Regenerate. * elf-bfd.h (elf_backend_bfd_from_remote_memory): Make LEN argument of target_read_memory as bfd_size_type. (_bfd_elf32_bfd_from_remote_memory): Likewise. (_bfd_elf64_bfd_from_remote_memory): Likewise. * elf.c (bfd_elf_bfd_from_remote_memory): Likewise. * elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): Likewise. gdb/ * symfile-mem.c: 3 new gdb_static_assert for target_read_memory_bfd parameters. (target_read_memory_bfd): New function. (symbol_file_add_from_memory): Use it. commit bc5feec2c1dd5ab0c8a51cd31b3ac5d57ae9ac74 Author: Doug Evans Date: Mon Jun 4 03:07:03 2012 +0000 * symtab.c (lookup_global_symbol_from_objfile): Only scan blockvector of primary symtab. (basic_lookup_transparent_type): Ditto. commit dd3e83238802b09fada91b3987ee69a32a11d73b Author: Doug Evans Date: Mon Jun 4 02:57:26 2012 +0000 * objfiles.h (ALL_OBJFILE_PRIMARY_SYMTABS): New macro. (ALL_PRIMARY_SYMTABS): Use it. (ALL_PSPACE_PRIMARY_SYMTABS): Ditto. * dwarf2read.c (dw2_find_symbol_file): Ditto. * linespec.c (iterate_over_all_matching_symtabs): Ditto. * symtab.c (lookup_symbol_aux_objfile): Ditto. (basic_lookup_transparent_type): Ditto. commit ad064eb42448f46eda90bd9a470916ce594534d4 Author: Alan Modra Date: Mon Jun 4 00:00:03 2012 +0000 daily update commit b3d1fe6202986451e4e03f3a13fb2f3274a2162a Author: gdbadmin Date: Mon Jun 4 00:00:02 2012 +0000 *** empty log message *** commit 6c7a701167748298ea55035e772a6cfe5f58f015 Author: Jan Kratochvil Date: Sun Jun 3 17:10:28 2012 +0000 gdb/testsuite/ * gdb.base/code_elim.exp (add-symbol-file ${testfile1} 0x100000) (add-symbol-file ${testfile2} 0x200000): Wrap them to 'order1' and 'order2'. (order1: add-symbol-file ${testfile1} 0x100000) (order1: add-symbol-file ${testfile2} 0x200000) (order2: add-symbol-file ${testfile2} 0x200000) (order2: add-symbol-file ${testfile1} 0x100000): Add -s .data and -s .bss as appropriate. commit df437be06b28736c584a33c81028d740ea7e84f4 Author: Jan Kratochvil Date: Sun Jun 3 17:06:04 2012 +0000 gdb/testsuite/ * gdb.base/code_elim.exp (add-symbol-file ${testfile1} 0x100000): Simplify it to ... (symbol-file ${testfile1}): ... here. (test eliminated var my_global_symbol) (test eliminated var my_static_symbol) (test eliminated var my_global_func, get address of main): Wrap them to 'single psymtabs' and 'single symtabs' (get address of my_global_symbol, get address of my_static_symbol) (get address of my_global_func, get address of main): Wrap them to 'order1' and 'order2'. commit 57b13094ffda1a3ee5055637b36b7871b86b41e8 Author: Alan Modra Date: Sun Jun 3 04:07:55 2012 +0000 PR binutils/13897 * elf.c (elf_find_function): Cache last function sym info. (_bfd_elf_maybe_function_sym): Return function size, pass in section of interest. * elf-bfd.h (struct elf_backend_data ): Likewise. (_bfd_elf_maybe_function_sym): Likewise. * elf64-ppc.c (ppc64_elf_maybe_function_sym): Likewise. (opd_entry_value): Add in_code_sec param. Revert caching code. Return -1 if in_code_sec and function found in wrong section. Update all calls. commit 945eb2562c507a126391cf5863b53efe89e67f2c Author: gdbadmin Date: Sun Jun 3 00:00:33 2012 +0000 *** empty log message *** commit 6b8f70451df78dc3c7b85de4ff85f6b4faebf500 Author: Alan Modra Date: Sun Jun 3 00:00:02 2012 +0000 daily update ----------------------------------------------------------------------- Summary of changes: bfd/ChangeLog | 141 +++ bfd/bfd-in.h | 3 +- bfd/bfd-in2.h | 5 +- bfd/elf-bfd.h | 22 +- bfd/elf-eh-frame.c | 43 +- bfd/elf.c | 137 ++-- bfd/elf32-i386.c | 54 +- bfd/elf32-ppc.c | 109 ++- bfd/elf64-ppc.c | 164 +++-- bfd/elf64-x86-64.c | 47 +- bfd/elfcode.h | 2 +- bfd/elflink.c | 71 +- bfd/opncls.c | 18 +- bfd/section.c | 45 +- bfd/version.h | 2 +- config/ChangeLog | 53 + config/asmcfi.m4 | 15 + config/math.m4 | 50 + config/mh-darwin | 4 +- config/mh-interix | 2 - config/mh-ppc-aix | 2 +- config/mmap.m4 | 97 ++ config/mt-alphaieee | 1 + config/mt-sde | 2 +- config/picflag.m4 | 5 +- config/stdint.m4 | 2 +- config/tcl.m4 | 6 +- config/weakref.m4 | 47 + gdb/ChangeLog | 471 +++++++++ gdb/Makefile.in | 10 +- gdb/NEWS | 6 + gdb/ada-lang.c | 3 +- gdb/aix-thread.c | 8 +- gdb/amd64-linux-tdep.c | 2 +- gdb/amd64-windows-tdep.c | 4 + gdb/arch-utils.c | 12 - gdb/arch-utils.h | 5 - gdb/breakpoint.c | 27 +- gdb/bsd-uthread.c | 2 +- gdb/buildsym.c | 20 +- gdb/common/agent.c | 6 +- gdb/common/buffer.c | 2 - gdb/common/gdb_signals.h | 24 +- gdb/common/signals.c | 274 +++--- gdb/config.in | 3 + gdb/config/djgpp/djcheck.sh | 15 + gdb/config/tilegx/linux.mh | 12 + gdb/configure | 50 +- gdb/configure.ac | 14 +- gdb/configure.host | 3 + gdb/configure.tgt | 6 + gdb/copyright.py | 17 +- gdb/corefile.c | 6 +- gdb/corelow.c | 21 +- gdb/cp-support.h | 5 - gdb/darwin-nat.c | 26 +- gdb/defs.h | 2 +- gdb/doc/ChangeLog | 9 + gdb/doc/gdb.texinfo | 59 ++- gdb/dwarf2-frame.c | 224 ++--- gdb/dwarf2expr.c | 168 ++-- gdb/dwarf2expr.h | 54 +- gdb/dwarf2loc.c | 337 +++++-- gdb/dwarf2loc.h | 4 + gdb/dwarf2read.c | 155 ++-- gdb/exec.c | 1 - gdb/fbsd-nat.c | 6 +- gdb/findvar.c | 50 +- gdb/fork-child.c | 12 +- gdb/gdbarch.c | 82 +- gdb/gdbarch.h | 50 +- gdb/gdbarch.sh | 38 +- gdb/gdbcore.h | 7 +- gdb/gdbserver/ChangeLog | 49 + gdb/gdbserver/Makefile.in | 5 + gdb/gdbserver/ax.c | 2 +- gdb/gdbserver/configure.srv | 6 + gdb/gdbserver/linux-low.c | 61 +- gdb/gdbserver/linux-tile-low.c | 142 +++ gdb/gdbserver/lynx-low.c | 8 +- gdb/gdbserver/nto-low.c | 10 +- gdb/gdbserver/server.c | 42 +- gdb/gdbserver/spu-low.c | 6 +- gdb/gdbserver/target.c | 8 +- gdb/gdbserver/target.h | 4 +- gdb/gdbserver/win32-low.c | 56 +- gdb/gdbthread.h | 2 +- gdb/gdbtypes.c | 27 +- gdb/gnu-nat.c | 28 +- gdb/go32-nat.c | 90 +- gdb/i386-cygwin-tdep.c | 3 + gdb/i386-linux-nat.c | 4 +- gdb/i386-linux-tdep.c | 2 +- gdb/i386fbsd-nat.c | 4 +- gdb/ia64-hpux-nat.c | 4 +- gdb/inf-child.c | 24 + gdb/inf-child.h | 5 + gdb/inf-ptrace.c | 6 +- gdb/inf-ttrace.c | 8 +- gdb/infcall.c | 2 +- gdb/infcmd.c | 52 +- gdb/inferior.h | 8 +- gdb/infrun.c | 291 +++--- gdb/linespec.c | 33 +- gdb/linux-nat.c | 79 +- gdb/linux-tdep.c | 12 +- gdb/linux-tdep.h | 2 +- gdb/linux-thread-db.c | 8 +- gdb/{inf-child.h => mi/mi-cmd-info.c} | 34 +- gdb/mi/mi-cmds.c | 1 + gdb/mi/mi-cmds.h | 1 + gdb/mi/mi-interp.c | 11 +- gdb/mi/mi-main.c | 2 +- gdb/mips-linux-nat.c | 2 +- gdb/mips-linux-tdep.c | 112 ++- gdb/monitor.c | 4 +- gdb/nto-procfs.c | 20 +- gdb/nto-tdep.c | 6 +- gdb/objfiles.c | 25 + gdb/objfiles.h | 17 +- gdb/osdata.c | 2 +- gdb/osdata.h | 1 + gdb/ppc-linux-nat.c | 25 +- gdb/procfs.c | 28 +- gdb/psymtab.c | 10 +- gdb/python/py-inferior.c | 2 +- gdb/python/py-signalevent.c | 4 +- gdb/python/py-stopevent.c | 6 +- gdb/python/py-stopevent.h | 4 +- gdb/ravenscar-thread.c | 4 +- gdb/record.c | 36 +- gdb/regformats/reg-tilegx.dat | 67 ++ gdb/remote-m32r-sdi.c | 12 +- gdb/remote-mips.c | 12 +- gdb/remote-sim.c | 14 +- gdb/remote.c | 36 +- gdb/rs6000-nat.c | 3 +- gdb/sol-thread.c | 2 +- gdb/solib-darwin.c | 116 ++- gdb/solib-irix.c | 4 +- gdb/solib-osf.c | 4 +- gdb/solib-spu.c | 2 +- gdb/solib-sunos.c | 4 +- gdb/solib-svr4.c | 14 +- gdb/solib.c | 2 - gdb/source.c | 19 + gdb/spu-linux-nat.c | 3 +- gdb/stabsread.c | 2 +- gdb/stabsread.h | 2 +- gdb/stubs/ChangeLog | 5 + gdb/stubs/ia64vms-stub.c | 2 +- gdb/symfile-mem.c | 21 +- gdb/symfile.c | 4 +- gdb/symfile.h | 4 +- gdb/symtab.c | 313 +++--- gdb/target.c | 44 +- gdb/target.h | 27 +- gdb/testsuite/ChangeLog | 91 ++ gdb/testsuite/gdb.ada/bad-task-bp-keyword.exp | 52 + gdb/testsuite/gdb.ada/bad-task-bp-keyword/foo.adb | 68 ++ gdb/testsuite/gdb.base/code_elim.exp | 96 +- gdb/testsuite/gdb.base/ctxobj-f.c | 7 +- gdb/testsuite/gdb.base/ctxobj-m.c | 10 +- gdb/testsuite/gdb.base/ctxobj.exp | 49 +- gdb/testsuite/gdb.base/dprintf.c | 18 +- gdb/testsuite/gdb.base/freebpcmd.exp | 9 +- gdb/testsuite/gdb.base/info-proc.exp | 23 +- gdb/testsuite/gdb.base/print-file-var-main.c | 9 +- gdb/testsuite/gdb.base/print-file-var.exp | 39 +- gdb/testsuite/gdb.base/signals.exp | 4 +- gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.S | 258 +++++ gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.exp | 41 + gdb/testsuite/gdb.mi/mi-info-os.exp | 38 + .../ctxobj-f.c => gdb.server/solib-list-lib.c} | 13 +- .../ctxobj-f.c => gdb.server/solib-list-main.c} | 12 +- gdb/testsuite/gdb.server/solib-list.exp | 104 ++ gdb/testsuite/gdb.trace/stap-trace.exp | 15 +- gdb/testsuite/gdb.trace/unavailable.exp | 2 +- gdb/tilegx-linux-nat.c | 187 ++++ gdb/tilegx-linux-tdep.c | 146 +++ gdb/tilegx-tdep.c | 1017 ++++++++++++++++++++ gdb/tilegx-tdep.h | 109 +++ gdb/tui/tui-hooks.c | 11 +- gdb/ui-out.c | 4 +- gdb/version.in | 2 +- gdb/windows-nat.c | 72 +- gdb/windows-tdep.c | 46 + gdb/windows-tdep.h | 5 + include/ChangeLog | 17 + include/dwarf2.def | 2 +- include/gdb/ChangeLog | 12 + include/gdb/callback.h | 2 +- include/gdb/signals.def | 300 +++--- include/gdb/signals.h | 4 +- include/leb128.h | 136 +++ libiberty/ChangeLog | 7 + libiberty/cp-demangle.c | 1 + libiberty/testsuite/demangle-expected | 4 + sim/arm/ChangeLog | 6 + sim/arm/wrapper.c | 6 +- sim/avr/ChangeLog | 6 + sim/avr/interp.c | 6 +- sim/common/ChangeLog | 20 + sim/common/sim-reason.c | 2 +- sim/common/sim-signal.c | 24 +- sim/common/sim-signal.h | 2 +- sim/cr16/ChangeLog | 6 + sim/cr16/interp.c | 6 +- sim/d10v/ChangeLog | 6 + sim/d10v/interp.c | 4 +- sim/erc32/ChangeLog | 6 + sim/erc32/interf.c | 4 +- sim/m32c/ChangeLog | 6 + sim/m32c/gdb-if.c | 20 +- sim/ppc/ChangeLog | 6 + sim/ppc/psim.c | 2 +- sim/ppc/sim_calls.c | 4 +- sim/rl78/ChangeLog | 6 + sim/rl78/gdb-if.c | 22 +- sim/rx/ChangeLog | 6 + sim/rx/gdb-if.c | 8 +- 221 files changed, 6687 insertions(+), 2188 deletions(-) create mode 100644 config/asmcfi.m4 create mode 100644 config/math.m4 delete mode 100644 config/mh-interix create mode 100644 config/mmap.m4 create mode 100644 config/weakref.m4 create mode 100644 gdb/config/tilegx/linux.mh create mode 100644 gdb/gdbserver/linux-tile-low.c copy gdb/{inf-child.h => mi/mi-cmd-info.c} (60%) create mode 100644 gdb/regformats/reg-tilegx.dat create mode 100644 gdb/testsuite/gdb.ada/bad-task-bp-keyword.exp create mode 100644 gdb/testsuite/gdb.ada/bad-task-bp-keyword/foo.adb create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.S create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.exp create mode 100644 gdb/testsuite/gdb.mi/mi-info-os.exp copy gdb/testsuite/{gdb.base/ctxobj-f.c => gdb.server/solib-list-lib.c} (84%) copy gdb/testsuite/{gdb.base/ctxobj-f.c => gdb.server/solib-list-main.c} (84%) create mode 100644 gdb/testsuite/gdb.server/solib-list.exp create mode 100644 gdb/tilegx-linux-nat.c create mode 100644 gdb/tilegx-linux-tdep.c create mode 100644 gdb/tilegx-tdep.c create mode 100644 gdb/tilegx-tdep.h create mode 100644 include/leb128.h First 500 lines of diff: diff --git a/bfd/ChangeLog b/bfd/ChangeLog index a77a28c..9874ff1 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,144 @@ +2012-06-04 Jan Kratochvil + + * bfd-in.h (bfd_elf_bfd_from_remote_memory): Make LEN argument + of target_read_memory as bfd_size_type. + * bfd-in2.h: Regenerate. + * elf-bfd.h (elf_backend_bfd_from_remote_memory): Make LEN + argument of target_read_memory as bfd_size_type. + (_bfd_elf32_bfd_from_remote_memory): Likewise. + (_bfd_elf64_bfd_from_remote_memory): Likewise. + * elf.c (bfd_elf_bfd_from_remote_memory): Likewise. + * elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): Likewise. + +2012-06-03 Alan Modra + + PR binutils/13897 + * elf.c (elf_find_function): Cache last function sym info. + (_bfd_elf_maybe_function_sym): Return function size, pass in + section of interest. + * elf-bfd.h (struct elf_backend_data ): Likewise. + (_bfd_elf_maybe_function_sym): Likewise. + * elf64-ppc.c (ppc64_elf_maybe_function_sym): Likewise. + (opd_entry_value): Add in_code_sec param. Revert caching code. + Return -1 if in_code_sec and function found in wrong section. + Update all calls. + +2012-06-01 Siddhesh Poyarekar + + * bfd-in.h (bfd_elf_bfd_from_remote_memory): Make LEN argument + of target_read_memory as size_t. + * bfd-in2.h: Regenerate. + * elf-bfd.h (elf_backend_bfd_from_remote_memory): Make LEN + argument of target_read_memory as size_t. + (_bfd_elf32_bfd_from_remote_memory): Likewise. + (_bfd_elf64_bfd_from_remote_memory): Likewise. + * elf.c (bfd_elf_bfd_from_remote_memory): Likewise. + * elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): Likewise. + +2012-06-01 Alan Modra + + PR binutils/13897 + * elf64-ppc.c (opd_entry_value): Rewrite cache code. + +2012-05-29 Tom Tromey + + * opncls.c (bfd_fopen): Always close fd on failure. + (bfd_fdopenr): Likewise. + +2012-05-27 Alan Modra + + PR ld/14170 + * elflink.c (_bfd_elf_merge_symbol): When a symbol defined in + a dynamic library finds a new instance with non-default + visibility in a regular object, correctly handle symbols + already on the undefs list and undo dynamic symbol state when + the new symbol is hidden or internal. + +2012-05-25 H.J. Lu + + * elf32-i386.c (elf_i386_create_dynamic_sections): Don't use + dynamic_sec_flags to create PLT .eh_frame section. + * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Likewise. + +2012-05-25 Alan Modra + + PR ld/13909 + * elf-eh-frame.c (_bfd_elf_eh_frame_present): New function. + (_bfd_elf_maybe_strip_eh_frame_hdr): Use it here. + * elf-bfd.h (_bfd_elf_eh_frame_present): Declare. + * elflink.c (bfd_elf_size_dynamic_sections): Let the backend + size dynamic sections before stripping eh_frame_hdr. + (bfd_elf_gc_sections): Handle multiple .eh_frame sections. + * elf32-ppc.c (ppc_elf_size_dynamic_sections): Drop glink_eh_frame + if no other .eh_frame sections exist. + * elf64-ppc.c (ppc64_elf_size_stubs): Likewise. + * elf32-i386.c (elf_i386_create_dynamic_sections): Don't size + or alloc plt_eh_frame here.. + (elf_i386_size_dynamic_sections): ..do it here instead. Don't + specially keep sgotplt, iplt, tgotplt, sdynbss for symbols. + (elf_i386_finish_dynamic_sections): Check plt_eh_frame->contents + before writing plt offset. + * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Don't size + or alloc plt_eh_frame here.. + (elf_x86_64_size_dynamic_sections): ..do it here instead. + (elf_x86_64_finish_dynamic_sections): Check plt_eh_frame->contents + before writing plt offset. + +2012-05-24 Alan Modra + + PR ld/14158 + * elf64-ppc.c (ppc64_elf_size_stubs): Round up glink_eh_frame + size to output section alignment. + (ppc64_elf_build_stubs): Likewise, and extend last FDE to cover. + +2012-05-23 Alan Modra + + * elf-eh-frame.c (_bfd_elf_maybe_strip_eh_frame_hdr): Handle + BFDs with multiple .eh_frame sections. + +2012-05-23 Alan Modra + + PR ld/13909 + * elflink.c (bfd_elf_discard_info): Don't ignore dynamic BFDs. + +2012-05-22 H.J. Lu + + PR ld/13909 + * elf32-i386.c (elf_i386_create_dynamic_sections): Revert the + last change. + * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Likewise. + +2012-05-22 Alan Modra + + * elflink.c (bfd_elf_discard_info): Look for next .eh_frame if + first one is zero size or discarded. + * elf32-ppc.c (ppc_elf_size_dynamic_sections): Set most of + glink_eh_frame contents here.. + (ppc_elf_finish_dynamic_sections): ..rather than here. Just set + offset to .glink. + +2012-05-22 H.J. Lu + + PR ld/13909 + * elf32-i386.c (elf_i386_create_dynamic_sections): Create PLT + eh_frame section if there is an input .eh_frame section. + * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Likewise. + +2012-05-22 H.J. Lu + + PR ld/14105 + * elf32-i386.c (elf_i386_create_dynamic_sections): Always + create PLT eh_frame section with SEC_LINKER_CREATED. + * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Likewise. + +2012-05-22 Alan Modra + + * elflink.c (bfd_elf_discard_info): Handle multiple .eh_frame + sections attached to a BFD. + * section.c (bfd_get_section_by_name): Rewrite description. + (bfd_get_next_section_by_name): New function. + * bfd-in2.h: Regenerate. + 2012-05-21 Andreas Schwab * elf32-m68k.c (elf_m68k_grok_prstatus): New function. diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index a61e721..5300b14 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -698,7 +698,8 @@ extern int bfd_get_elf_phdrs the remote memory. */ extern bfd *bfd_elf_bfd_from_remote_memory (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, int len)); + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); extern struct bfd_section *_bfd_elf_tls_setup (bfd *, struct bfd_link_info *); diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 7535483..8798ae4 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -705,7 +705,8 @@ extern int bfd_get_elf_phdrs the remote memory. */ extern bfd *bfd_elf_bfd_from_remote_memory (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, int len)); + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); extern struct bfd_section *_bfd_elf_tls_setup (bfd *, struct bfd_link_info *); @@ -1704,6 +1705,8 @@ void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); +asection *bfd_get_next_section_by_name (asection *sec); + asection *bfd_get_section_by_name_if (bfd *abfd, const char *name, diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index b07d8c4..889ce12 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1186,7 +1186,8 @@ struct elf_backend_data see elf.c, elfcode.h. */ bfd *(*elf_backend_bfd_from_remote_memory) (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, int len)); + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); /* This function is used by `_bfd_elf_get_synthetic_symtab'; see elf.c. */ @@ -1222,10 +1223,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 asymbol *sym, - asection **code_sec, bfd_vma *code_off); + /* If the ELF symbol SYM might be a function in SEC, return the + function size and set *CODE_OFF to the function's entry point, + otherwise return zero. */ + bfd_size_type (*maybe_function_sym) (const asymbol *sym, asection *sec, + bfd_vma *code_off); /* Used to handle bad SHF_LINK_ORDER input. */ bfd_error_handler_type link_order_error_handler; @@ -1950,6 +1952,8 @@ extern bfd_boolean _bfd_elf_write_section_eh_frame (bfd *, struct bfd_link_info *, asection *, bfd_byte *); extern bfd_boolean _bfd_elf_write_section_eh_frame_hdr (bfd *, struct bfd_link_info *); +extern bfd_boolean _bfd_elf_eh_frame_present + (struct bfd_link_info *); extern bfd_boolean _bfd_elf_maybe_strip_eh_frame_hdr (struct bfd_link_info *); @@ -2205,8 +2209,8 @@ 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 asymbol *, - asection **, bfd_vma *); +extern bfd_size_type _bfd_elf_maybe_function_sym (const asymbol *, asection *, + bfd_vma *); extern int bfd_elf_get_default_section_type (flagword); @@ -2258,10 +2262,10 @@ extern char *elfcore_write_register_note extern bfd *_bfd_elf32_bfd_from_remote_memory (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma, bfd_byte *, int)); + int (*target_read_memory) (bfd_vma, bfd_byte *, bfd_size_type)); extern bfd *_bfd_elf64_bfd_from_remote_memory (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma, bfd_byte *, int)); + int (*target_read_memory) (bfd_vma, bfd_byte *, bfd_size_type)); extern bfd_vma bfd_elf_obj_attr_size (bfd *); extern void bfd_elf_set_obj_attr_contents (bfd *, bfd_byte *, bfd_vma); diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c index 8ec34ab..a75d806 100644 --- a/bfd/elf-eh-frame.c +++ b/bfd/elf-eh-frame.c @@ -1247,6 +1247,26 @@ _bfd_elf_discard_section_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info) return TRUE; } +/* Return true if there is at least one non-empty .eh_frame section in + input files. Can only be called after ld has mapped input to + output sections, and before sections are stripped. */ +bfd_boolean +_bfd_elf_eh_frame_present (struct bfd_link_info *info) +{ + asection *eh = bfd_get_section_by_name (info->output_bfd, ".eh_frame"); + + if (eh == NULL) + return FALSE; + + /* Count only sections which have at least a single CIE or FDE. + There cannot be any CIE or FDE <= 8 bytes. */ + for (eh = eh->map_head.s; eh != NULL; eh = eh->map_head.s) + if (eh->size > 8) + return TRUE; + + return FALSE; +} + /* This function is called from size_dynamic_sections. It needs to decide whether .eh_frame_hdr should be output or not, because when the dynamic symbol table has been sized it is too late @@ -1255,8 +1275,6 @@ _bfd_elf_discard_section_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info) bfd_boolean _bfd_elf_maybe_strip_eh_frame_hdr (struct bfd_link_info *info) { - asection *o; - bfd *abfd; struct elf_link_hash_table *htab; struct eh_frame_hdr_info *hdr_info; @@ -1265,24 +1283,9 @@ _bfd_elf_maybe_strip_eh_frame_hdr (struct bfd_link_info *info) if (hdr_info->hdr_sec == NULL) return TRUE; - if (bfd_is_abs_section (hdr_info->hdr_sec->output_section)) - { - hdr_info->hdr_sec = NULL; - return TRUE; - } - - abfd = NULL; - if (info->eh_frame_hdr) - for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link_next) - { - /* Count only sections which have at least a single CIE or FDE. - There cannot be any CIE or FDE <= 8 bytes. */ - o = bfd_get_section_by_name (abfd, ".eh_frame"); - if (o && o->size > 8 && !bfd_is_abs_section (o->output_section)) - break; - } - - if (abfd == NULL) + if (bfd_is_abs_section (hdr_info->hdr_sec->output_section) + || !info->eh_frame_hdr + || !_bfd_elf_eh_frame_present (info)) { hdr_info->hdr_sec->flags |= SEC_EXCLUDE; hdr_info->hdr_sec = NULL; diff --git a/bfd/elf.c b/bfd/elf.c index c5b04ac..d97da9f 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -7407,59 +7407,74 @@ elf_find_function (bfd *abfd, const char **filename_ptr, const char **functionname_ptr) { - const char *filename; - asymbol *func, *file; - bfd_vma low_func; - asymbol **p; - /* ??? Given multiple file symbols, it is impossible to reliably - choose the right file name for global symbols. File symbols are - local symbols, and thus all file symbols must sort before any - global symbols. The ELF spec may be interpreted to say that a - file symbol must sort before other local symbols, but currently - ld -r doesn't do this. So, for ld -r output, it is possible to - make a better choice of file name for local symbols by ignoring - file symbols appearing after a given local symbol. */ - enum { nothing_seen, symbol_seen, file_after_symbol_seen } state; - const struct elf_backend_data *bed = get_elf_backend_data (abfd); + static asection *last_section; + static asymbol *func; + static const char *filename; + static bfd_size_type func_size; if (symbols == NULL) return FALSE; - filename = NULL; - func = NULL; - file = NULL; - low_func = 0; - state = nothing_seen; - - for (p = symbols; *p != NULL; p++) - { - asymbol *sym = *p; - asection *code_sec; - bfd_vma code_off; - - if ((sym->flags & BSF_FILE) != 0) - { - file = sym; - if (state == symbol_seen) - state = file_after_symbol_seen; - continue; - } + if (last_section != section + || func == NULL + || offset < func->value + || offset >= func->value + func_size) + { + asymbol *file; + bfd_vma low_func; + asymbol **p; + /* ??? Given multiple file symbols, it is impossible to reliably + choose the right file name for global symbols. File symbols are + local symbols, and thus all file symbols must sort before any + global symbols. The ELF spec may be interpreted to say that a + file symbol must sort before other local symbols, but currently + ld -r doesn't do this. So, for ld -r output, it is possible to + make a better choice of file name for local symbols by ignoring + file symbols appearing after a given local symbol. */ + enum { nothing_seen, symbol_seen, file_after_symbol_seen } state; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + + filename = NULL; + func = NULL; + file = NULL; + low_func = 0; + state = nothing_seen; + func_size = 0; + last_section = section; + + for (p = symbols; *p != NULL; p++) + { + asymbol *sym = *p; + bfd_vma code_off; + bfd_size_type size; + + if ((sym->flags & BSF_FILE) != 0) + { + file = sym; + if (state == symbol_seen) + state = file_after_symbol_seen; + continue; + } - if (bed->maybe_function_sym (sym, &code_sec, &code_off) - && code_sec == section - && code_off >= low_func - && code_off <= offset) - { - func = sym; - low_func = code_off; - filename = NULL; - if (file != NULL - && ((sym->flags & BSF_LOCAL) != 0 - || state != file_after_symbol_seen)) - filename = bfd_asymbol_name (file); + size = bed->maybe_function_sym (sym, section, &code_off); + if (size != 0 + && code_off <= offset + && (code_off > low_func + || (code_off == low_func + && size > func_size))) + { + func = sym; + func_size = size; + low_func = code_off; + filename = NULL; + if (file != NULL + && ((sym->flags & BSF_LOCAL) != 0 + || state != file_after_symbol_seen)) + filename = bfd_asymbol_name (file); + } + if (state == nothing_seen) + state = symbol_seen; } - if (state == nothing_seen) - state = symbol_seen; } if (func == NULL) @@ -9556,7 +9571,7 @@ bfd_elf_bfd_from_remote_memory (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma, bfd_byte *, int)) + int (*target_read_memory) (bfd_vma, bfd_byte *, bfd_size_type)) { return (*get_elf_backend_data (templ)->elf_backend_bfd_from_remote_memory) (templ, ehdr_vma, loadbasep, target_read_memory); @@ -9714,18 +9729,26 @@ _bfd_elf_is_function_type (unsigned int type) || 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. */ +/* If the ELF symbol SYM might be a function in SEC, return the + function size and set *CODE_OFF to the function's entry point, + otherwise return zero. */ -bfd_boolean -_bfd_elf_maybe_function_sym (const asymbol *sym, - asection **code_sec, bfd_vma *code_off) +bfd_size_type +_bfd_elf_maybe_function_sym (const asymbol *sym, asection *sec, + bfd_vma *code_off) { + bfd_size_type size; + if ((sym->flags & (BSF_SECTION_SYM | BSF_FILE | BSF_OBJECT - | BSF_THREAD_LOCAL | BSF_RELC | BSF_SRELC)) != 0) - return FALSE; + | BSF_THREAD_LOCAL | BSF_RELC | BSF_SRELC)) != 0 + || sym->section != sec) + return 0; - *code_sec = sym->section; *code_off = sym->value; - return TRUE; + size = 0; + if (!(sym->flags & BSF_SYNTHETIC)) + size = ((elf_symbol_type *) sym)->internal_elf_sym.st_size; + if (size == 0) + size = 1; + return size; } diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index dd49486..6aa386d 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -1015,22 +1015,17 @@ elf_i386_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info) return FALSE; if (!info->no_ld_generated_unwind_info - && bfd_get_section_by_name (dynobj, ".eh_frame") == NULL + && htab->plt_eh_frame == NULL && htab->elf.splt != NULL) { hooks/post-receive -- Repository for Project Archer.