]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
10 years agoAdd extern_protected_data and set it for x86
H.J. Lu [Thu, 5 Mar 2015 14:34:39 +0000 (06:34 -0800)] 
Add extern_protected_data and set it for x86

With copy relocation, address of protected data defined in the shared
library may be external.  This patch adds extern_protected_data and
changes _bfd_elf_symbol_refs_local_p to return false for protected data
if extern_protected_data is true.

Backport from master:

bfd/

PR ld/pr15228
PR ld/pr17709
* elf-bfd.h (elf_backend_data): Add extern_protected_data.
* elf32-i386.c (elf_backend_extern_protected_data): New.
Defined to 1.
* elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
* elflink.c (_bfd_elf_adjust_dynamic_copy): Don't error on
copy relocs against protected symbols if extern_protected_data
is true.
(_bfd_elf_symbol_refs_local_p): Don't return true on protected
non-function symbols if extern_protected_data is true.
* elfxx-target.h (elf_backend_extern_protected_data): New.
Default to 0.
(elfNN_bed): Initialize extern_protected_data with
elf_backend_extern_protected_data.

ld/testsuite/

PR ld/pr15228
PR ld/pr17709
* ld-i386/i386.exp (i386tests): Add a test for PR ld/17709.
* ld-i386/pr17709-nacl.rd: New file.
* ld-i386/pr17709.rd: Likewise.
* ld-i386/pr17709a.s: Likewise.
* ld-i386/pr17709b.s: Likewise.
* ld-i386/protected3.d: Updated.
* ld-i386/protected3.s: Likewise.
* ld-x86-64/pr17709-nacl.rd: New file.
* ld-x86-64/pr17709.rd: Likewise.
* ld-x86-64/pr17709a.s: Likewise.
* ld-x86-64/pr17709b.s: Likewise.
* ld-x86-64/protected3.d: Updated.
* ld-x86-64/protected3.s: Likewise.
* ld-x86-64/x86-64.exp (x86_64tests): Add a test for PR ld/17709.

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 6 Mar 2015 00:00:54 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 5 Mar 2015 00:00:58 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 4 Mar 2015 00:00:48 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 3 Mar 2015 00:00:47 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 2 Mar 2015 00:00:40 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 1 Mar 2015 00:00:43 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 28 Feb 2015 00:01:07 +0000 (00:01 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 27 Feb 2015 00:00:49 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 26 Feb 2015 00:00:45 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 25 Feb 2015 00:00:41 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 24 Feb 2015 00:01:09 +0000 (00:01 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 23 Feb 2015 00:00:54 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoSet GOLD_DEFAULT_SIZE to 32 for x32
H.J. Lu [Sun, 22 Feb 2015 13:18:50 +0000 (05:18 -0800)] 
Set GOLD_DEFAULT_SIZE to 32 for x32

Cherry-pick from master:
* configure.ac (default_size): Set to 32 for x32.
* configure: Regenerated.

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 22 Feb 2015 00:00:54 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 21 Feb 2015 00:00:43 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 20 Feb 2015 00:00:52 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 19 Feb 2015 00:00:47 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 18 Feb 2015 00:00:45 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 17 Feb 2015 00:00:43 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 16 Feb 2015 00:00:50 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 15 Feb 2015 00:00:47 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 14 Feb 2015 00:00:58 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 13 Feb 2015 00:00:50 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 12 Feb 2015 00:00:49 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoDon't segfault or assert on NULL tls_sec
Alan Modra [Thu, 29 Jan 2015 09:08:28 +0000 (19:38 +1030)] 
Don't segfault or assert on NULL tls_sec

Real code won't hit these, but it's possible to contrive a testcase..

* elf32-ppc.c (ppc_elf_relocate_section): Don't segfault on NULL
tls_sec.
* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
* elflink.c (elf_link_output_extsym): Don't assert on NULL tls_sec.

10 years agoCorrect GOLD PowerPC64 local-dynamic TLS linker optimization
Alan Modra [Thu, 29 Jan 2015 10:03:26 +0000 (20:33 +1030)] 
Correct GOLD PowerPC64 local-dynamic TLS linker optimization

Similar to b86ac8e3

* powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
and GOT_TLSGD to LE optimization.

10 years agoCorrect PowerPC64 local-dynamic TLS linker optimization
Alan Modra [Thu, 29 Jan 2015 00:39:55 +0000 (11:09 +1030)] 
Correct PowerPC64 local-dynamic TLS linker optimization

The linker hardcoded r3 into a local-dynamic to local-exec TLS
optimization sequence.  This is normally the case since r3 is required
as a parameter to (the optimized out) __tls_get_addr call.  However,
it is possible for a compiler, LLVM in this case, to set up the
parameter value in another register then copy it to r3 before the
call.

When fixing this problem, I noticed that ppc32 had another bug when
optimizing away one of the TLS insns to a nop.

The patch also tidies a mask used by global-dynamic to initial-exec
TLS optimization, to just select the fields needed.  Leaving the
offset in the instruction wasn't a bug since it will be overwritten
anyway.

bfd/
* elf64-ppc.c (ppc64_elf_relocate_section): Correct GOT_TLSLD
optimization.  Tidy mask for GOT_TLSGD optimization.
* elf32-ppc.c (ppc_elf_relocate_section): Likewise.  Correct
location of nop zapping high insn too.
ld/testsuite/
* ld-powerpc/tlsld.d, * ld-powerpc/tlsld.s: New test.
* ld-powerpc/tlsld32.d, * ld-powerpc/tlsld32.s: New test.
* ld-powerpc/powerpc.exp: Run them.

10 years ago[GOLD] Correct powerpc64 ifunc plt entry test
Alan Modra [Thu, 22 Jan 2015 02:09:50 +0000 (12:39 +1030)] 
[GOLD] Correct powerpc64 ifunc plt entry test

Found when attempting to build an ELFv2 Linux kernel.  We don't
generally need a plt entry for ELFv2 got relocs, only on ifunc, just
like ppc32.

* powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
condition for need of ifunc plt entry.
(Target_powerpc::Scan::global <got relocs>): Likewise.

10 years agold: Update expected test results for 32-bit hosts.
Andrew Burgess [Tue, 20 Jan 2015 16:00:41 +0000 (16:00 +0000)] 
ld: Update expected test results for 32-bit hosts.

Tests that I added in commit c05b575a8dfabab6af5d8586d1a5c0c67f819ac2
fails on 32-bit hosts due to differences in whitespace.

This patch updates the expected output patterns to be more accepting of
differences in whitespace, the tests should now pass.

ld/testsuite/ChangeLog:

* ld-scripts/provide-4-map.d: Update expected output.
* ld-scripts/provide-5-map.d: Likewise.

10 years agold: Don't evaluate unneeded PROVIDE expressions.
Andrew Burgess [Wed, 7 Jan 2015 10:51:35 +0000 (10:51 +0000)] 
ld: Don't evaluate unneeded PROVIDE expressions.

When creating a linker mapfile (using -Map=MAPFILE), we previously would
always try to evaluate the expression from a PROVIDE statement.

However, this is not always safe, consider:

  PROVIDE (foo = 0x10);
  PROVIDE (bar = foo);

In this example, if neither 'foo' or 'bar' is needed, then while
generating the linker mapfile evaluating the expression for 'foo' is
harmless (just the value 0x10).  However, evaluating the expression for
'bar' requires the symbol 'foo', which is undefined.  This used to cause
a fatal error.

This patch changes the behaviour, so that when the destination of the
PROVIDE is not defined (that is the PROVIDE is not going to provide
anything) the expression is not evaluated, and instead a special string
is displayed to indicate that the linker is discarding the PROVIDE
statement.

This change not only fixes the spurious undefined symbol error, but also
means that a user can now tell if a PROVIDE statement has provided
anything by inspecting the linker mapfile, something that could not be
done before.

ld/ChangeLog:

* ldlang.c (print_assignment): Only evaluate the expression for a
PROVIDE'd assignment when the destination is being defined.
Display a special message for PROVIDE'd symbols that are not being
provided.

ld/testsuite/ChangeLog:

* ld-scripts/provide-4.d: New file.
* ld-scripts/provide-4-map.d: New file.
* ld-scripts/provide-4.t: New file.
* ld-scripts/provide-5.d: New file.
* ld-scripts/provide-5.s: New file.
* ld-scripts/provide-5-map.d: New file.
* ld-scripts/provide-5.t: New file.
* ld-scripts/provide.exp: Run the provide-4.d and provide-5.d
tests.

10 years agold/testing: run_dump_test can now check linker mapfiles.
Andrew Burgess [Tue, 6 Jan 2015 23:40:48 +0000 (23:40 +0000)] 
ld/testing: run_dump_test can now check linker mapfiles.

Add a new option 'map' to the ld run_dump_test mechanism.  When the
'map' option is given run_dump_test will ensure that there is a
-Map=MAPFILE present in the linker command line, adding one if needed.

The MAPFILE is then compared with the file passed to the new 'map'
option using the regexp_diff function.  This should make it slightly
easier to write tests that check the linker mapfile output.

The only test I found that already compares mapfile content is updated
to use the new mechanism.

ld/testsuite/ChangeLog:

* ld-scripts/overlay-size.d: Add 'map' option.
* ld-scripts/overlay-size.exp: Remove manual check of mapfile.
* lib/ld-lib.exp (run_dump_test): Add support for new 'map'
option, checking linker mapfile output.

10 years agoFix garbage collection of common symbols for powerpc64
Alan Modra [Tue, 20 Jan 2015 00:36:28 +0000 (11:06 +1030)] 
Fix garbage collection of common symbols for powerpc64

I forgot powerpc64 has its own gc_mark_dynamic_ref.

PR ld/17615
* elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Don't drop
ELF_COMMON_DEF syms.

10 years agoFix garbage collection of common symbols
Alan Modra [Sat, 17 Jan 2015 11:03:43 +0000 (21:33 +1030)] 
Fix garbage collection of common symbols

Running lang_common before garbage collection means slightly less work
in garbage collection code, since common symbols should no longer
appear there.  It does have the side effect of keeping linker script
symbols (at least those defined outside of sections) global too,
hence some testsuite churn.

bfd/
PR 17165
* elf-bfd.h (ELF_COMMON_DEF): Note that this might be true for
linker script assignments too.
* elflink.c (elf_gc_sweep_symbol): Don't drop ELF_COMMON_DEF syms.
(bfd_elf_gc_mark_dynamic_ref_symbol): Similarly.
ld/
PR 17165
* ldlang.c (lang_process): Run lang_common before lang_gc_sections.
ld/testsuite/
* ld-gc/pr14265.d,
* ld-cris/tls-gc-68.d,
* ld-cris/tls-gc-69.d,
* ld-cris/tls-gc-70.d,
* ld-cris/tls-gc-71.d,
* ld-cris/tls-gc-75.d,
* ld-cris/tls-gc-76.d,
* ld-cris/tls-gc-79.d,
* ld-mmix/bpo-10.d,
* ld-mmix/bpo-11.d: Update.

10 years agoOmit section dynsyms for any linker created section
Alan Modra [Thu, 15 Jan 2015 08:37:33 +0000 (19:07 +1030)] 
Omit section dynsyms for any linker created section

This is a simplification, and fixes a testcase I had where an empty
powerpc64 .branch_lt section was chosen for the data_index_section
dynamic symbol and thus wasn't removed.

* elflink.c (_bfd_elf_link_omit_section_dynsym): Return true for
any output section matching a linker created dynobj section.

10 years agoFix ARM fail of gap test
Alan Modra [Thu, 15 Jan 2015 09:12:59 +0000 (19:42 +1030)] 
Fix ARM fail of gap test

ld-elf/gap test was failing due to the ARM backend attempting to output
arch symbols when ld -s (strip all symbols) is in force.  This patch
stops that happening and tidies the code a little.

PR 17842
* elflink.c (elf_link_output_sym): Assert elf_onesymtab set.
(bfd_elf_final_link): Always create a symbol table when emit_relocs.
Don't assign symtab file position unless symbols will be output.
Merge blocks with condition in common.  Don't call
elf_backend_output_arch_local_syms or elf_backend_output_arch_syms
unless other symbols are output.  Move assignment of symtab_shndx
file position.  Localize variable.

10 years agoFix build without makeinfo from release binutils tar
Alan Modra [Mon, 12 Jan 2015 09:54:12 +0000 (20:24 +1030)] 
Fix build without makeinfo from release binutils tar

PR 17817
* Makefile.am (aoutx.stamp): cp -p $srcdir/aoutx.texi to keep
timestamps so that makeinfo need not be installed.
(archive.stamp, archures.stamp, bfdt.stamp, cache.stamp,
coffcode.stamp, core.stamp, elf.stamp, elfcode.stamp, mmo.stamp,
format.stamp, libbfd.stamp, bfdio.stamp, bfdwin.stamp,
opncls.stamp, reloc.stamp, section.stamp, syms.stamp, targets.stamp,
init.stamp, hash.stamp, linker.stamp): Similarly.
(bfdver.texi): Use test rather than [ ] in commands.
* Makefile.in: Regenerate.

10 years agoAssorted compiler warning fixes
Alan Modra [Sat, 10 Jan 2015 22:00:33 +0000 (08:30 +1030)] 
Assorted compiler warning fixes

The C standard doesn't guarantee a function pointer can be cast to
void* and vice versa.

binutils/
* prdbg.c (print_debugging_info): Don't use void* for function
pointer param.
* budbg.h (print_debugging_info): Update prototype.
gas/
* read.c (s_altmacro, s_reloc): Make definition static.

10 years agoDelete unnecessary code copying SHF_SH5_ISA32 flag
Alan Modra [Fri, 26 Dec 2014 07:56:38 +0000 (18:26 +1030)] 
Delete unnecessary code copying SHF_SH5_ISA32 flag

Since 2006, commit d270463e9, _bfd_elf_copy_private_section_data has
copied over SHF_MASKOS and SHF_MASKPROC flags.  That makes the buggy
code in sh_elf64_copy_private_data_internal redundant.

bfd/
PR 17755
* elf64-sh64.c (sh_elf64_copy_private_data_internal): Delete code
copying SHF_SH5_ISA32.
binutils/testsuite/
* binutils-all/strip-11.d: New test.
* binutils-all/objcopy.exp: Run it.

10 years agoDon't create .eh_frame_hdr on shared lib bfd
Alan Modra [Wed, 24 Dec 2014 11:37:42 +0000 (22:07 +1030)] 
Don't create .eh_frame_hdr on shared lib bfd

If no object files have .eh_frame, but some shared library does, then
ld creates a .eh_frame_hdr section using the shared library bfd.  This
is silly since shared library .eh_frame sections don't contribute to
the output .eh_frame and thus no .eh_frame_hdr is needed.

Also, the bfd section list and count is cleared for shared libraries,
and a zero section count used as a flag in lang_check to omit a call
to bfd_merge_private_bfd_data for shared libraries.  If we create a
section on a shared lib bfd then ld will wrongly attempt to merge the
shared library private bfd data.

PR 17742
* ld/emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Exclude
shared libraries in loop looking for .eh_frame sections.
Similarly for build-id loop.

10 years agoUse a symbol flag bit to mark linker defined symbols
Alan Modra [Tue, 23 Dec 2014 08:37:23 +0000 (19:07 +1030)] 
Use a symbol flag bit to mark linker defined symbols

Trying to use the SEC_LINKER_CREATED section flag to determine whether
a symbol is linker defined fails to work on targets like alpha that
define special SEC_COMMON sections.  These might contain symbols that
originated in an object file.

include/
* bfdlink.h (struct bfd_link_hash_entry): Comment non_ir_ref.  Add
linker_def.
bfd/
* elflink.c (_bfd_elf_define_linkage_sym): Set linker_def.
* linker.c (_bfd_generic_link_add_one_symbol): Clear linker_def
for CDEF, DEF, DEFW, COM.
ld/
* ldexp.c (exp_fold_tree_1 <etree_provide>): Test linker_def.
ld/testsuite/
* ld-powerpc/sdabase.s,
* ld-powerpc/sdabase.t,
* ld-powerpc/sdabase.d: New test.
* ld-powerpc/sdabase2.t,
* ld-powerpc/sdabase2.d: New test.
* ld-powerpc/powerpc.exp: Run them.

10 years agoDon't PROVIDE over top of common symbols
Alan Modra [Mon, 22 Dec 2014 00:19:23 +0000 (10:49 +1030)] 
Don't PROVIDE over top of common symbols

This:
  int end[100000];
  int main(void) { end[99999] = 0; return 0; }
should not segfault.

ld/
* ldexp.c (exp_fold_tree_1 <etree_provide>): Leave bfd_link_hash_common
symbols alone.
ld/testsuite/
* ld-elf/endsym.s, *ld-elf/endsym.d: New test.

10 years agoCorrect logic for "defined by object"
Alan Modra [Mon, 22 Dec 2014 04:13:49 +0000 (14:43 +1030)] 
Correct logic for "defined by object"

The old code missed testing bfd_link_hash_undefweak, and wrongly
excluded bfd_link_hash_common symbols.  It is also clearer to invert
the set of enum bfd_link_hash_type values tested.
bfd_link_hash_indirect and bfd_link_hash_warning will never appear
here.

* ldexp.c (update_definedness): Correct logic setting by_object.

10 years agoMove support code for linker script DEFINED to ldexp.c
Alan Modra [Mon, 22 Dec 2014 00:15:13 +0000 (10:45 +1030)] 
Move support code for linker script DEFINED to ldexp.c

This moves support code for DEFINED to ldexp.c where it is used,
losing the lang_ prefix on identifiers.  Two new functions are needed
to initialize and clean up to hash table, but other than that there
are no functional changes here.

* ldexp.c (struct definedness_hash_entry, definedness_table)
(definedness_newfunc, symbol_defined, update_definedness): Move
and rename from..
* ldlang.h (struct lang_definedness_hash_entry): ..here,..
* ldlang.c (lang_definedness_table, lang_definedness_newfunc)
(lang_symbol_defined, lang_update_definedness): ..and here.
* ldexp.c (ldexp_init, ldexp_finish): New functions, extracted from..
* ldlang.c (lang_init, lang_finish): ..here.
* ldexp.h (ldexp_init, ldexp_finish): Declare.
* ldlang.h (lang_symbol_defined, lang_update_definedness): Delete.
* ldmain.c (main): Call ldexp_init and ldexp_finish.

10 years ago[GOLD] Fix powerpc overflow check
Cary Coutant [Mon, 22 Dec 2014 18:13:37 +0000 (10:13 -0800)] 
[GOLD] Fix powerpc overflow check

* powerpc.cc (Target_powerpc::relocate): Fix overflow check.

10 years agoSet ppc COMMONPAGESIZE to 64k
Richard Henderson [Thu, 18 Dec 2014 21:40:25 +0000 (15:40 -0600)] 
Set ppc COMMONPAGESIZE to 64k

bfd/
* elf32-ppc.c (ELF_COMMONPAGESIZE): Set to 64k.
* elf64-ppc.c (ELF_COMMONPAGESIZE): Likewise.

10 years agoDisplay DW_LANG_C11 as (C11).
Mark Wielaard [Thu, 18 Dec 2014 02:35:53 +0000 (13:05 +1030)] 
Display DW_LANG_C11 as (C11).

* dwarf.c (read_and_display_attr_value): Change display name of
DW_LANG_C11 from (ANSI C11) to (C11).

10 years agoPowerPC register numbers in DWARF
Alan Modra [Fri, 12 Dec 2014 05:32:34 +0000 (16:02 +1030)] 
PowerPC register numbers in DWARF

This makes gas .cfi output to .debug_frame match register numbering
emitted by gcc.  md_reg_eh_frame_to_debug_frame follows the ABI,
targets not using it, notably Linux, don't.

* config/tc-ppc.h (md_reg_eh_frame_to_debug_frame): Match current
gcc behaviour.
* config/te-aix.h: New file.
* configure.tgt: Use em=aix for powerpc-aix.

10 years agoSet bfd_error in _bfd_elf_adjust_dynamic_copy
Alan Modra [Fri, 12 Dec 2014 13:09:14 +0000 (23:39 +1030)] 
Set bfd_error in _bfd_elf_adjust_dynamic_copy

PR 15228
* elflink.c (_bfd_elf_adjust_dynamic_copy): Call bfd_set_error.

10 years agoCopy relocations against protected symbols
Alan Modra [Fri, 12 Dec 2014 12:23:46 +0000 (22:53 +1030)] 
Copy relocations against protected symbols

Copy relocs are used in a scheme to avoid dynamic text relocations in
non-PIC executables that refer to variables defined in shared
libraries.  The idea is to have the linker define any such variable in
the executable, with a copy reloc copying the initial value, then have
both the executable and shared library refer to the executable copy.
If the shared library defines the variable as protected then we have
two copies of the variable being used.

PR 15228
* elflink.c (_bfd_elf_adjust_dynamic_copy): Add "info" param.
Error on copy relocs against protected symbols.
(elf_merge_st_other): Set h->protected_def.
* elf-bfd.h (struct elf_link_hash_entry): Add "protected_def".
(_bfd_elf_adjust_dynamic_copy): Update prototype.
* elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Update
_bfd_elf_adjust_dynamic_copy call.
* elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise.
* elf32-cr16.c (_bfd_cr16_elf_adjust_dynamic_symbol): Likewise.
* elf32-cris.c (elf_cris_adjust_dynamic_symbol): Likewise.
* elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise.
* elf32-i370.c (i370_elf_adjust_dynamic_symbol): Likewise.
* elf32-i386.c (elf_i386_adjust_dynamic_symbol): Likewise.
* elf32-lm32.c (lm32_elf_adjust_dynamic_symbol): Likewise.
* elf32-m32r.c (m32r_elf_adjust_dynamic_symbol): Likewise.
* elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
* elf32-metag.c (elf_metag_adjust_dynamic_symbol): Likewise.
* elf32-or1k.c (or1k_elf_adjust_dynamic_symbol): Likewise.
* elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise.
* elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
* elf32-sh.c (sh_elf_adjust_dynamic_symbol): Likewise.
* elf32-tic6x.c (elf32_tic6x_adjust_dynamic_symbol): Likewise.
* elf32-tilepro.c (tilepro_elf_adjust_dynamic_symbol): Likewise.
* elf32-vax.c (elf_vax_adjust_dynamic_symbol): Likewise.
* elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
* elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
* elf64-sh64.c (sh64_elf64_adjust_dynamic_symbol): Likewise.
* elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
* elfnn-aarch64.c (elfNN_aarch64_adjust_dynamic_symbol): Likewise.
* elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
* elfxx-sparc.c (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise.
* elfxx-tilegx.c (tilegx_elf_adjust_dynamic_symbol): Likewise.

10 years agoUse autoconf check for long long in binutils
Alan Modra [Thu, 11 Dec 2014 05:32:35 +0000 (16:02 +1030)] 
Use autoconf check for long long in binutils

* configure.ac: Check for long long and sizes of long long and long.
* elfcomm.h (HOST_WIDEST_INT): Test HAVE_LONG_LONG in place of
__STDC_VERSION__ and __GNUC__.
* strings.c (print_strings): Likewise.
* dwarf.c (DWARF_VMA_FMT, DWARF_VMA_FMT_LONG): Likewise.
* configure: Regenerate.
* config.in: Regenerate.

10 years agoDon't return DW_AT_name for function name in C++
Alan Modra [Tue, 9 Dec 2014 23:21:56 +0000 (09:51 +1030)] 
Don't return DW_AT_name for function name in C++

DW_AT_name for functions typically just contains the base function
name, so lacks namespace, class and parameter information.  It would
be possible to extract all these from the DWARF, but at a considerable
complication of the parser in dwarf2.c, and then you'd need to mangle
it all together.  Much simpler is to look up the actual symbol.  This
patch does that, avoiding the extra symbol lookup when the language
doesn't do name mangling.

PR 17541
* dwarf2.c (struct comp_unit): Add "lang".
(non_mangled): New function.
(struct funcinfo): Add "is_linkage".  Reorder for better packing.
Make "name" a const char*.
(lookup_address_in_function_table): Delete functionname_ptr param.
(find_abstract_instance_name): Add is_linkage param.  Set if we
have DW_AT_linkage_name or non_mangled DW_AT_name.
(scan_unit_for_symbols): Similarly set func->is_linkage.
(parse_comp_unit): Stash DW_AT_language.
(comp_unit_find_nearest_line): Replace functionname_ptr param
with function_ptr param.
(_bfd_dwarf2_find_nearest_line): Adjust above calls.  Set
functionname_ptr from function->name.  Call _bfd_elf_find_function
to retrieve symbol for function if not linkage name.
(_bfd_elf_find_function): Add bfd_target_elf_flavour test, moved from..
* elf.c (elf_find_function): ..here.
(_bfd_elf_find_nearest_line): Adjust calls.
* elf-bfd.h (_bfd_elf_find_function): Declare.

10 years agoDon't sort ld -r relocs for mips
Alan Modra [Tue, 9 Dec 2014 04:02:22 +0000 (14:32 +1030)] 
Don't sort ld -r relocs for mips

HI16/LO16 are deliberately put adjacent, which might mean relocs are
then not sorted by r_offset.  See tc-mips.c:mips_frob_file.  Don't undo
the HI16/LO16 sorting.

PR 17666
* elf-bfd.h (struct elf_backend_data): Add sort_relocs_p.
* elfxx-target.h (elf_backend_sort_relocs_p): Define.
(elfNN_bed): Init new field.
* elflink.c (elf_link_adjust_relocs): Conditionally sort.
(bfd_elf_final_link): Control sorting of relocs.
* elfxx-mips.c (_bfd_mips_elf_sort_relocs_p): New function.
* elfxx-mips.h (_bfd_mips_elf_sort_relocs_p): Declare.
* elf32-mips.c (elf_backend_sort_relocs_p): Define.
* elf64-mips.c (elf_backend_sort_relocs_p): Define.

10 years agoppc64_elf_edit_opd revamp, take 2
Alan Modra [Tue, 9 Dec 2014 04:01:01 +0000 (14:31 +1030)] 
ppc64_elf_edit_opd revamp, take 2

Now that ld -r relocs are sorted by the pr17666 fix, there isn't so
much need to sort incoming relocs.

* elf64-ppc.c (sort_r_offset): Delete.
(ppc64_elf_edit_opd): Don't sort input relocs.

10 years agoSort relocs output by ld -r
Alan Modra [Wed, 3 Dec 2014 11:30:18 +0000 (22:00 +1030)] 
Sort relocs output by ld -r

bfd/
PR 17666
* elflink.c: Include bfd_stdint.h.
(cmp_ext32l_r_offset, cmp_ext32b_r_offset,
cmp_ext64l_r_offset, cmp_ext64b_r_offset): New functions.
(elf_link_adjust_relocs): Sort relocs.  Free reloc hashes after
sorting invalidates.
ld/testsuite/
* ld-powerpc/vxworks-relax.rd: Update for reloc sorting.
* ld-powerpc/vxworks-relax-2.rd: Likewise.
* ld-sh/sh64/reldl32.rd: Likewise.
* ld-sh/sh64/reldl64.rd: Likewise.

10 years agoppc64_elf_edit_opd revamp
Alan Modra [Tue, 2 Dec 2014 04:39:16 +0000 (15:09 +1030)] 
ppc64_elf_edit_opd revamp

This patch sorts .opd relocs (see pr17666) and allows .opd sections
with a mix of 16 and 24 byte entries to be edited.

* elf64-ppc.c (OPD_NDX): Define.  Use throughout for sizing/indexing
_opd_sec_data array, halving required memory.
(sort_r_offset): New function.
(ppc64_elf_edit_opd): Sort incoming relocs.  Accept .opd
sections with a mix of 16 and 24 byte OPD entries.  Don't
attempt to honour --non-overlapping-opd for .opd sections with
unexpected relocs.  Simplify opd entry size calculations by
first finding the reloc for the next entry.  Make edit loop
handle one opd entry per iteration, with an inner loop
handling relocs per entry.

10 years agodwarf.c handle new DWARFv5 C11, C++11 and C++14 DW_LANG constants.
Mark Wielaard [Mon, 24 Nov 2014 20:24:25 +0000 (21:24 +0100)] 
dwarf.c handle new DWARFv5 C11, C++11 and C++14 DW_LANG constants.

binutils/ChangeLog

* dwarf.c (read_and_display_attr_value): Handle DW_LANG_C11,
DW_LANG_C_plus_plus_11 and DW_LANG_C_plus_plus_14.

10 years agoRecognize new DWARFv5 C11, C++11 and C++14 DW_LANG constants.
Mark Wielaard [Mon, 24 Nov 2014 19:51:06 +0000 (20:51 +0100)] 
Recognize new DWARFv5 C11, C++11 and C++14 DW_LANG constants.

include/ChangeLog

* dwarf2.h: Add DW_LANG_C_plus_plus_11, DW_LANG_C11 and
DW_LANG_C_plus_plus_14.

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 11 Feb 2015 00:00:48 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 10 Feb 2015 00:00:54 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 9 Feb 2015 00:00:49 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 8 Feb 2015 00:00:53 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 7 Feb 2015 00:00:44 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 6 Feb 2015 00:00:54 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 5 Feb 2015 00:00:46 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 4 Feb 2015 00:00:47 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 3 Feb 2015 00:01:03 +0000 (00:01 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 2 Feb 2015 00:00:46 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 1 Feb 2015 00:00:46 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 31 Jan 2015 00:00:49 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 30 Jan 2015 00:01:35 +0000 (00:01 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 29 Jan 2015 00:01:08 +0000 (00:01 +0000)] 
Automatic date update in version.in

10 years ago[ARM] Backport vcmp/vcmpe should accept #0x0 as an operand
Jiong Wang [Wed, 28 Jan 2015 09:55:51 +0000 (09:55 +0000)] 
[ARM] Backport vcmp/vcmpe should accept #0x0 as an operand

  gas/
  2015-01-28  Matthew Wahab  <matthew.wahab@arm.com>

    * config/tc-arm.c (parse_ifimm_zero): Accept #0x0 as a synonym for
    #0, restoring previous behaviour.

  testsuite/
  2015-01-28  Matthew Wahab  <matthew.wahab@arm.com>

    * gas/arm/ual-vcmp.s: Add vcmp, vcmpe with #0x0 operand.
    * gas/ual/vcmp.d: Update expected output.
    * gas/ual/vcmp-zero-bad.l: Likewise

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 28 Jan 2015 00:01:13 +0000 (00:01 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 27 Jan 2015 00:01:29 +0000 (00:01 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 26 Jan 2015 00:04:21 +0000 (00:04 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 25 Jan 2015 00:01:41 +0000 (00:01 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 24 Jan 2015 00:01:15 +0000 (00:01 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 23 Jan 2015 00:01:25 +0000 (00:01 +0000)] 
Automatic date update in version.in

10 years agoBackport from master:
Terry Guo [Thu, 22 Jan 2015 08:34:44 +0000 (16:34 +0800)] 
Backport from master:

bfd/ChangeLog:
2015-01-22  Thomas Preud'homme  <thomas.preudhomme@arm.com>

Backport from mainline
2015-01-13  Thomas Preud'homme <thomas.preudhomme@arm.com>

* elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
SYMBOLIC_BIND to check if a symbol should be bound symbolically.

ld/testsuite/ChangeLog:
2015-01-22  Thomas Preud'homme <thomas.preudhomme@arm.com>

Backport from mainline
2015-01-13  Thomas Preud'homme <thomas.preudhomme@arm.com>

* ld-aarch64/aarch64-elf.exp: Added relocs-257-symbolic-func
test.
* ld-aarch64/relocs-257-symbolic-func.d: New file.
* ld-aarch64/relocs-257-symbolic-func.s: Likewise.

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 22 Jan 2015 00:01:10 +0000 (00:01 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 21 Jan 2015 00:01:08 +0000 (00:01 +0000)] 
Automatic date update in version.in

10 years agoBackport from master:
Chung-Lin Tang [Tue, 20 Jan 2015 04:26:39 +0000 (20:26 -0800)] 
Backport from master:

Define elf_backend_default_execstack as 0 for Nios II.

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 20 Jan 2015 00:00:58 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 19 Jan 2015 00:00:54 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 18 Jan 2015 00:02:20 +0000 (00:02 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 17 Jan 2015 00:01:02 +0000 (00:01 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 16 Jan 2015 00:00:50 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 15 Jan 2015 00:01:07 +0000 (00:01 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 14 Jan 2015 00:00:49 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 13 Jan 2015 00:00:56 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 12 Jan 2015 00:01:01 +0000 (00:01 +0000)] 
Automatic date update in version.in

10 years agoOnly discard space for pc-relative relocs symbols
H.J. Lu [Sun, 11 Jan 2015 16:04:27 +0000 (08:04 -0800)] 
Only discard space for pc-relative relocs symbols

When building PIE, we should only discard space for pc-relative relocs
symbols which turn out to need copy relocs.

bfd/

PR ld/17827
* elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): For PIE,
only discard space for pc-relative relocs symbols which turn
out to need copy relocs.

ld/testsuite/

PR ld/17827
* ld-x86-64/pr17689.out: Updated.
* ld-x86-64/pr17689b.S: Likewise.

* ld-x86-64/pr17827.rd: New file.

* ld-x86-64/x86-64.exp: Run PR ld/17827 test.

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 11 Jan 2015 00:01:13 +0000 (00:01 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 10 Jan 2015 00:01:04 +0000 (00:01 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 9 Jan 2015 00:01:10 +0000 (00:01 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 8 Jan 2015 00:00:59 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoHandle stack split for x32
H.J. Lu [Thu, 18 Dec 2014 19:09:28 +0000 (11:09 -0800)] 
Handle stack split for x32

X32 uses cmp %fs:NN,%esp, lea NN(%rsp),%r10d, lea NN(%rsp),%r11d,
instead of cmp %fs:NN,%rsp, lea NN(%rsp),%r10, lea NN(%rsp),%r11.
This patch handles it.

PR gold/17729
* configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
(DEFAULT_TARGET_X32): Set for x32.
* x86_64.cc (cmp_insn_32): New.
(lea_r10_insn_32): Likewise.
(lea_r11_insn_32): Likewise.
(cmp_insn_64): Likewise.
(lea_r10_insn_64): Likewise.
(lea_r11_insn_64): Likewise.
(Target_x86_64<size>::do_calls_non_split): Handle x32.
* testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
(check_DATA): Add split_x32 files.
(split_x32_[1234n].o): New targets.
(split_x32_[124]): New targets.
(split_x32_[1234r].stdout): New targets.
* testsuite/split_x32.sh: New file.
* testsuite/split_x32_1.s: Likewise.
* testsuite/split_x32_2.s: Likewise.
* testsuite/split_x32_3.s: Likewise.
* testsuite/split_x32_4.s: Likewise.
* testsuite/split_x32_n.s: Likewise.
* configure: Regenerated.
* testsuite/Makefile.in: Likewise.

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 7 Jan 2015 00:01:02 +0000 (00:01 +0000)] 
Automatic date update in version.in

10 years agoHandle Initial-Exec to Local-Exec for x32
H.J. Lu [Tue, 6 Jan 2015 20:58:54 +0000 (12:58 -0800)] 
Handle Initial-Exec to Local-Exec for x32

PR gold/17809
* x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
x32.