From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25514 invoked by alias); 23 Mar 2012 14:48:43 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 25441 invoked by uid 9514); 23 Mar 2012 14:48:38 -0000 Date: Fri, 23 Mar 2012 14:48:00 -0000 Message-ID: <20120323144838.25426.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: 999c175b15ed114fa5e7ffe0aff7891cd16845af X-Git-Newrev: b755687278b49a949add8bb903f0dc4f53e35d1b X-SW-Source: 2012-q1/txt/msg00080.txt.bz2 List-Id: The branch, archer-pmuldoon-python-backtrace has been updated via b755687278b49a949add8bb903f0dc4f53e35d1b (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) via c99aab9dc7c3a1bf110176158f87a630c08a719f (commit) via fda4b74499e5d26b718a51b84ec637e435997fa6 (commit) via 88a05594363f87bf8fa19b0832c3fa96a61cbcf6 (commit) via 7be9989f3742c1a538e5736c86165e1aa03bc563 (commit) via a7f9ca9cb797d653dc7919538e1dfa0c26010331 (commit) via 4c128abac9c5ae4c9f11f85d842cdc0c666499dc (commit) via 111bb24e08681edb232d7f8b0ac2b8bed3196fad (commit) via 442ce9b2cb41503472ed40a869324160b2579d1b (commit) via 18e847d87b24578d0972f1db0d968a3bf2cc2766 (commit) via 090670303d7de01450f38a906bfe3752f25ba783 (commit) via 92ab086d5a3f9dc7e03dfe21c98b70274fc411ea (commit) via 6080f942dde1a88ecfa33cead8fad514b87b6d7b (commit) via e9051f959054c7c0e19515f8174d894726d345e9 (commit) via 856b6d33858f363c9f7b4f1276ffc1c35f336cf7 (commit) via b878b3dd27664f3c1aea39f6bc5173c6054a0b4b (commit) via b8ccb946064deec565e9649fb1eba34817f5fded (commit) via a653dea6799b8e39d42cb7e133541a69e30cb238 (commit) via 9faa4a2a8ed056f9d999a7f0559e8e581e5a0bbc (commit) via c44fcf813d108cd1e63c067117f72f6cc130ad53 (commit) via 23f3d45fa5cccdb7bb331f23484555e662a2ae4a (commit) via 03ae95e867a4c94f0bdf7a2358cedc39a19a1fdb (commit) via 35d2e24b5a91d04403d10514e896f68df8b40dea (commit) via dff5a25c1f0ade13d791de1864948696381debeb (commit) via f0a040c143cbcec1244eebc0970b32013fb98a8a (commit) via 107d4a8ed2758747ffea0ca6ce5796f8dba96157 (commit) from 999c175b15ed114fa5e7ffe0aff7891cd16845af (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit b755687278b49a949add8bb903f0dc4f53e35d1b Merge: 999c175 238a89c Author: Phil Muldoon Date: Fri Mar 23 14:48:23 2012 +0000 Merge remote-tracking branch 'gdb/master' into archer-pmuldoon-python-backtrace commit 238a89c5e410f61d2786cffca0a55dcf50325cd4 Author: Alan Modra Date: Fri Mar 23 09:34:57 2012 +0000 * elf.c (assign_file_positions_for_non_load_sections): Don't warn on empty alloc sections. commit 7bd3bcfebb31726b090ee1e94a598f7b1ae97ff8 Author: Alan Modra Date: Fri Mar 23 09:27:40 2012 +0000 * 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. commit 483b15745ae9f8ea4490ca5fb87cb9c1405785a4 Author: Alan Modra Date: Fri Mar 23 06:41:20 2012 +0000 PR binutils/13894 * elf64-ppc.c (opd_entry_value): Read full symbol table when sym hashes unavailable. commit 3fa74e6cd934b778a46812e85aacb75f5bb8ebf0 Author: Mike Frysinger Date: Fri Mar 23 04:30:55 2012 +0000 sim: testsuite: regen configure after rl78 addition commit abef1f2b99a19695e75d2b8caca0409d68377a68 Author: Mike Frysinger Date: Fri Mar 23 04:00:23 2012 +0000 sim: rx: fix warnings with AC_DEFINE This lets `autoheader` work again. Signed-off-by: Mike Frysinger commit 68a5e2c18948f7654ff9e1ba942e6384223eafd1 Author: Mike Frysinger Date: Fri Mar 23 03:27:44 2012 +0000 sim: sync build_warnings handling with gdb The sim code gets the logic for SIM_AC_OPTION_WARNINGS from gdb, but it hasn't been updated in a good long while. Sync with the latest gdb code. There is a sim specific change in here: we disable -Werror for now. This is because all sim code atm contains warnings. Will probably have to slowly add a white list of targets which can tolerate this until everyone is updated. Signed-off-by: Mike Frysinger commit 1ee91b8dc930c4a3093ada1ff16e46247143415f Author: gdbadmin Date: Fri Mar 23 00:00:33 2012 +0000 *** empty log message *** commit de9e84839d6034a7ceeb77c774f2e36e48cbd97d Author: Alan Modra Date: Thu Mar 22 23:00:05 2012 +0000 daily update commit bee9c58b7e871312ed9f00f244dcfc3ea7888c0d Author: Richard Henderson Date: Thu Mar 22 20:36:34 2012 +0000 * sparc-linux-nat.c (_initialize_sparc_linux_nat): Fix prototype. * sparc-nat.c (sparc_xfer_wcookie): Make static. commit 104ac57ff96d3a8854569062910c42f7a9f762af Author: Richard Henderson Date: Thu Mar 22 20:33:39 2012 +0000 * jit.c (jit_read_code_entry): Compute alignment and offset of int64_t member before computing entry_size. commit 6b02e7db494f5b445c71de1f59b034854008002b Author: sivachandra Date: Thu Mar 22 08:10:40 2012 +0000 2012-03-14 Siva Chandra 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. * testsuite/gdb.python/py-value.cc: Add test case for testing the methodology exposing C++ values to Python. * testsuite/gdb.python/py-value-cc.exp: Add tests testing the methodology exposing C++ values to Python. * testsuite/gdb.python/Makefile.in: Add py-value-cc to EXECUTABLES. * docs/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. commit 5371d4e89fdf618acf847a6337a8c91b99c673fa Author: sivachandra Date: Thu Mar 22 07:48:33 2012 +0000 2012-03-22 Siva Chandra Reddy * MAINTAINERS (Write After Approval): Add myself to the list. commit db6edb160e34a79d59886896b36650ac4e089539 Author: gdbadmin Date: Thu Mar 22 00:00:03 2012 +0000 *** empty log message *** ----------------------------------------------------------------------- Summary of changes: bfd/ChangeLog | 51 +++ bfd/bfd-in.h | 3 + bfd/bfd-in2.h | 3 + bfd/config.in | 3 + bfd/configure | 16 + bfd/configure.in | 3 + bfd/elf.c | 13 +- bfd/elf32-i386.c | 1 + bfd/elf32-tic6x.c | 3 + bfd/elf64-ppc.c | 9 +- bfd/elf64-x86-64.c | 3 +- bfd/elflink.c | 21 +- bfd/linker.c | 143 ++++---- bfd/plugin.c | 37 ++ bfd/version.h | 2 +- gdb/.gitignore | 2 + gdb/ChangeLog | 154 ++++++++- gdb/MAINTAINERS | 1 + gdb/NEWS | 10 + gdb/amd64-linux-nat.c | 4 +- gdb/amd64-tdep.c | 2 +- gdb/arm-linux-nat.c | 2 +- gdb/ax-gdb.c | 2 +- gdb/doc/ChangeLog | 14 + gdb/doc/gdb.texinfo | 105 +++++- gdb/dwarf2expr.c | 52 ++- gdb/dwarf2expr.h | 25 +- gdb/dwarf2loc.c | 45 ++- gdb/dwarf2loc.h | 6 +- gdb/dwarf2read.c | 365 ++++++++++-------- gdb/expprint.c | 3 +- gdb/expression.h | 2 + gdb/gdbserver/.gitignore | 8 + gdb/gdbserver/ChangeLog | 23 ++ gdb/gdbserver/linux-arm-low.c | 2 +- gdb/gdbserver/linux-low.c | 10 +- gdb/gdbserver/linux-low.h | 5 +- gdb/gdbserver/linux-x86-low.c | 4 +- gdb/gdbserver/server.c | 24 +- gdb/gnu-v3-abi.c | 2 +- gdb/ia64-linux-nat.c | 2 +- gdb/jit.c | 13 +- gdb/linux-nat.c | 16 +- gdb/linux-nat.h | 6 +- gdb/main.c | 121 ++++-- gdb/ppc-linux-nat.c | 2 +- gdb/procfs.c | 2 +- gdb/python/py-auto-load.c | 15 +- gdb/python/py-value.c | 43 ++ gdb/remote.c | 2 + gdb/sparc-linux-nat.c | 2 +- gdb/sparc-nat.c | 2 +- gdb/symtab.c | 2 +- gdb/testsuite/ChangeLog | 22 + gdb/testsuite/gdb.base/auxv.c | 15 + gdb/testsuite/gdb.base/auxv.exp | 7 +- gdb/testsuite/gdb.gdb/selftest.exp | 20 +- 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/version.in | 2 +- sim/common/ChangeLog | 6 + sim/common/acinclude.m4 | 64 ++-- sim/rx/ChangeLog | 5 + sim/rx/configure.ac | 6 +- sim/testsuite/ChangeLog | 613 ------------------------------ sim/testsuite/configure | 3 + sim/testsuite/sim/arm/ChangeLog | 117 ++++++ sim/testsuite/sim/cris/ChangeLog | 154 ++++++++ sim/testsuite/sim/cris/asm/addqpc.ms | 2 +- sim/testsuite/sim/cris/asm/boundmv32.ms | 2 +- sim/testsuite/sim/cris/asm/fidxd.ms | 2 +- sim/testsuite/sim/cris/asm/fidxi.ms | 2 +- sim/testsuite/sim/cris/asm/ftagd.ms | 2 +- sim/testsuite/sim/cris/asm/ftagi.ms | 2 +- sim/testsuite/sim/cris/asm/halt.ms | 2 +- sim/testsuite/sim/cris/asm/io6.ms | 2 +- sim/testsuite/sim/cris/asm/io7.ms | 2 +- sim/testsuite/sim/cris/asm/io8.ms | 2 +- sim/testsuite/sim/cris/asm/io9.ms | 2 +- sim/testsuite/sim/cris/asm/movecpc.ms | 2 +- sim/testsuite/sim/cris/asm/movempc.ms | 2 +- sim/testsuite/sim/cris/asm/movepcb.ms | 2 +- sim/testsuite/sim/cris/asm/movepcd.ms | 2 +- sim/testsuite/sim/cris/asm/movepcw.ms | 2 +- sim/testsuite/sim/cris/asm/moveqpc.ms | 2 +- sim/testsuite/sim/cris/asm/moverbpc.ms | 2 +- sim/testsuite/sim/cris/asm/moverdpc.ms | 2 +- sim/testsuite/sim/cris/asm/moverpcb.ms | 2 +- sim/testsuite/sim/cris/asm/moverpcw.ms | 2 +- sim/testsuite/sim/cris/asm/moverwpc.ms | 2 +- sim/testsuite/sim/cris/asm/movppc.ms | 2 +- sim/testsuite/sim/cris/asm/movrss.ms | 2 +- sim/testsuite/sim/cris/asm/movscpc.ms | 2 +- sim/testsuite/sim/cris/asm/movsmpc.ms | 2 +- sim/testsuite/sim/cris/asm/movsrpc.ms | 2 +- sim/testsuite/sim/cris/asm/movssr.ms | 2 +- sim/testsuite/sim/cris/asm/movucpc.ms | 2 +- sim/testsuite/sim/cris/asm/movumpc.ms | 2 +- sim/testsuite/sim/cris/asm/movurpc.ms | 2 +- sim/testsuite/sim/cris/asm/msteppc1.ms | 2 +- sim/testsuite/sim/cris/asm/msteppc2.ms | 2 +- sim/testsuite/sim/cris/asm/msteppc3.ms | 2 +- sim/testsuite/sim/cris/asm/rfg.ms | 2 +- sim/testsuite/sim/cris/asm/sbfs.ms | 2 +- sim/testsuite/sim/cris/asm/subqpc.ms | 2 +- sim/testsuite/sim/fr30/ChangeLog | 112 ++++++ sim/testsuite/sim/frv/ChangeLog | 76 ++++ sim/testsuite/sim/m32r/ChangeLog | 122 ++++++ sim/testsuite/sim/v850/ChangeLog | 19 + 110 files changed, 1847 insertions(+), 1090 deletions(-) create mode 100644 gdb/testsuite/gdb.python/py-value-cc.exp create mode 100644 gdb/testsuite/gdb.python/py-value.cc create mode 100644 sim/testsuite/sim/arm/ChangeLog create mode 100644 sim/testsuite/sim/cris/ChangeLog create mode 100644 sim/testsuite/sim/fr30/ChangeLog create mode 100644 sim/testsuite/sim/frv/ChangeLog create mode 100644 sim/testsuite/sim/m32r/ChangeLog create mode 100644 sim/testsuite/sim/v850/ChangeLog First 500 lines of diff: diff --git a/bfd/ChangeLog b/bfd/ChangeLog index b9849f8..04c3b31 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,54 @@ +2012-03-23 Alan Modra + + * elf.c (assign_file_positions_for_non_load_sections): Don't warn + on empty alloc sections. + +2012-03-23 Alan Modra + + * 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 + + PR binutils/13894 + * elf64-ppc.c (opd_entry_value): Read full symbol table when + sym hashes unavailable. + +2012-03-21 Eliot Dresselhaus + + * elf32-tic6x.c (elf32_tic6x_merge_private_bfd_data): Return TRUE + for non-C6X objects. + +2012-03-20 Kai Tietz + + PR ld/12742 + * configure.in (AC_CHECK_HEADERS): Test for windows.h and dlfcn.h. + * plugin.c: Guard include of dlfcn.h if HAVE_DLFCN_H is defined. + Add windows.h header include if HAVE_WINDOWS_H is defined. + (dlerror): New static function if windows variant is used instead + of dlfcn.h. + (dlclose): Likewise. + (dlopen): Likewise. + (dlsym): Likewise. + * configure: Regenerated. + * config.in: Regenerated. + +2012-03-20 H.J. Lu + + PR ld/13880 + * elf32-i386.c (elf_i386_relocate_section): Don't issue an error + for R_386_GOTOFF relocation against protected function if + SYMBOLIC_BIND is true. + + * elf64-x86-64.c (elf_x86_64_relocate_section): Don't issue an + error for R_X86_64_GOTOFF64 relocation against protected function + when building executable or SYMBOLIC_BIND is true. + 2012-03-16 Roland McGrath * config.bfd: Handle x86_64-*-nacl*. 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/config.in b/bfd/config.in index 98157e1..cb53b14 100644 --- a/bfd/config.in +++ b/bfd/config.in @@ -245,6 +245,9 @@ /* Define if has win32_pstatus_t. */ #undef HAVE_WIN32_PSTATUS_T +/* Define to 1 if you have the header file. */ +#undef HAVE_WINDOWS_H + /* Define to 1 if you have the header file. */ #undef HAVE_ZLIB_H diff --git a/bfd/configure b/bfd/configure index cff9b26..58a57ba 100755 --- a/bfd/configure +++ b/bfd/configure @@ -13508,6 +13508,22 @@ fi fi + +for ac_header in windows.h dlfcn.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether string.h and strings.h may both be included" >&5 $as_echo_n "checking whether string.h and strings.h may both be included... " >&6; } if test "${gcc_cv_header_string+set}" = set; then : diff --git a/bfd/configure.in b/bfd/configure.in index c40c825..f443915 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -190,6 +190,9 @@ AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h sys/stat.h) GCC_HEADER_STDINT(bfd_stdint.h) AC_HEADER_TIME AC_HEADER_DIRENT + +AC_CHECK_HEADERS(windows.h dlfcn.h) + ACX_HEADER_STRING AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid fileno) AC_CHECK_FUNCS(strtoull) 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/elf32-i386.c b/bfd/elf32-i386.c index 4ae2166..f35e3c2 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -3503,6 +3503,7 @@ elf_i386_relocate_section (bfd *output_bfd, return FALSE; } else if (!info->executable + && !SYMBOLIC_BIND (info, h) && h->type == STT_FUNC && ELF_ST_VISIBILITY (h->other) == STV_PROTECTED) { diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c index 6d6b59b..8abfdd0 100644 --- a/bfd/elf32-tic6x.c +++ b/bfd/elf32-tic6x.c @@ -4011,6 +4011,9 @@ elf32_tic6x_merge_private_bfd_data (bfd *ibfd, bfd *obfd) if (!_bfd_generic_verify_endian_match (ibfd, obfd)) return FALSE; + if (! is_tic6x_elf (ibfd) || ! is_tic6x_elf (obfd)) + return TRUE; + if (!elf32_tic6x_merge_attributes (ibfd, obfd)) return FALSE; 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/elf64-x86-64.c b/bfd/elf64-x86-64.c index f2f803a..cc5ee42 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -3464,8 +3464,9 @@ elf_x86_64_relocate_section (bfd *output_bfd, /* Check to make sure it isn't a protected function symbol for shared library since it may not be local when used as function address. */ - if (info->shared + if (!info->executable && h + && !SYMBOLIC_BIND (info, h) && h->def_regular && h->type == STT_FUNC && ELF_ST_VISIBILITY (h->other) == STV_PROTECTED) 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/plugin.c b/bfd/plugin.c index 064e273..0a29e37 100644 --- a/bfd/plugin.c +++ b/bfd/plugin.c @@ -25,7 +25,13 @@ #if BFD_SUPPORTS_PLUGINS #include +#ifdef HAVE_DLFCN_H #include +#elif defined (HAVE_WINDOWS_H) +#include +#else +#error Unknown how to handle dynamic-load-libraries. +#endif #include #include "plugin-api.h" #include "sysdep.h" @@ -34,6 +40,37 @@ #include "libiberty.h" #include +#if !defined (HAVE_DLFCN_H) && defined (HAVE_WINDOWS_H) + +#define RTLD_NOW 0 /* Dummy value. */ + +static void * +dlopen (const char *file, int mode ATTRIBUTE_UNUSED) +{ + return LoadLibrary (file); +} + +static void * +dlsym (void *handle, const char *name) +{ + return GetProcAddress (handle, name); +} + +static int ATTRIBUTE_UNUSED +dlclose (void *handle) +{ + FreeLibrary (handle); + return 0; +} + +static const char * +dlerror (void) +{ + return "Unable to load DLL."; +} + +#endif /* !defined (HAVE_DLFCN_H) && defined (HAVE_WINDOWS_H) */ + #define bfd_plugin_close_and_cleanup _bfd_generic_close_and_cleanup #define bfd_plugin_bfd_free_cached_info _bfd_generic_bfd_free_cached_info #define bfd_plugin_new_section_hook _bfd_generic_new_section_hook diff --git a/bfd/version.h b/bfd/version.h index 241c6fe..afd724b 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -1,4 +1,4 @@ -#define BFD_VERSION_DATE 20120319 +#define BFD_VERSION_DATE 20120323 #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/.gitignore b/gdb/.gitignore index f0cbd8c..7a0dd1a 100644 --- a/gdb/.gitignore +++ b/gdb/.gitignore @@ -7,7 +7,9 @@ hooks/post-receive -- Repository for Project Archer.