]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
11 years agodaily update
Alan Modra [Thu, 19 Jun 2014 00:00:41 +0000 (09:30 +0930)] 
daily update

11 years agoDon't free linker hash table
Alan Modra [Wed, 18 Jun 2014 00:21:10 +0000 (09:51 +0930)] 
Don't free linker hash table

PR 17047
* ldlang.c (lang_finish): Don't free linker hash table.

11 years agodaily update
Alan Modra [Wed, 18 Jun 2014 00:00:31 +0000 (09:30 +0930)] 
daily update

11 years agoFix duplicated assignments to __rel_iplt and __rela_iplt symbols
Alan Modra [Mon, 16 Jun 2014 12:51:16 +0000 (22:21 +0930)] 
Fix duplicated assignments to __rel_iplt and __rela_iplt symbols

* scripttempl/elf.sc: Edit out __rela_iplt symbol assignments from
.rel sections, and __rel_iplt from .rela sections.

11 years agodaily update
Alan Modra [Tue, 17 Jun 2014 00:00:36 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Mon, 16 Jun 2014 00:00:16 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Sun, 15 Jun 2014 00:00:37 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Sat, 14 Jun 2014 00:00:40 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Fri, 13 Jun 2014 00:00:41 +0000 (09:30 +0930)] 
daily update

11 years agoRegenerate msp430 file to pick up cosmetic changes
Alan Modra [Sun, 8 Jun 2014 03:12:26 +0000 (12:42 +0930)] 
Regenerate msp430 file to pick up cosmetic changes

* msp430-decode.c: Regenerate.

11 years agoPROVIDE in linker script vs. built-in symbols
Alan Modra [Sat, 7 Jun 2014 04:28:53 +0000 (13:58 +0930)] 
PROVIDE in linker script vs. built-in symbols

* ldexp.c (exp_fold_tree_1 <etree_provide>): Make PROVIDEd
linker script symbol value override a built-in linker symbol.

11 years agoAllow both signed and unsigned fields in PowerPC cmpli insn
Alan Modra [Sat, 7 Jun 2014 02:39:04 +0000 (12:09 +0930)] 
Allow both signed and unsigned fields in PowerPC cmpli insn

There are legitimate reasons to allow a signed value in a cmpli insn
field, for example to test for a "stw r1,lock@sdarel(r13)" instruction
in user code, a kernel might use
subis r3,r3,STW_R1_0R13@ha # subtract off high part
cmplwi r3,lock@sdarel # is low part accessing lock?
Since the lock@sdarel may take a range of -32768 to 32767,
the allowed range of cmpli immediate must be at least [-32768,65535].

bfd/
* elf32-ppc.c (ppc_elf_relocate_section): Treat field of cmpli
insn as a bitfield; Use complain_overflow_bitfield.
* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
opcodes/
* ppc-opc.c (UISIGNOPT): Define and use with cmpli.
gas/
* config/tc-ppc.c (ppc_insert_operand): Handle PPC_OPERAND_SIGNOPT
on unsigned fields.  Comment on PPC_OPERAND_SIGNOPT signed fields
in 64-bit mode.
gold/
* powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.

11 years agoSupport fusion for ELFv2 stubs
Alan Modra [Tue, 3 Jun 2014 01:25:29 +0000 (10:55 +0930)] 
Support fusion for ELFv2 stubs

Power8 fuses addis,addi and addis,ld sequences when the target of the
addis is the same as the addi/ld.  Thus
    addis r12,r2,xxx@ha
    addi r12,r12,xxx@l / ld r12,xxx@l(r12)
is faster than
    addis r11,r2,xxx@ha
    addi r12,r11,xxx@l / ld r12,xxx@l(r11)
So use the form that allows fusion in plt call and branch stubs.

bfd/
* elf64-ppc.c (ADDIS_R12_R2): Define.
(build_plt_stub): Support fusion on ELFv2 stub.
(ppc_build_one_stub): Likewise for plt branch stubs.
gold/
* powerpc.cc (addis_12_2): Define.
(Stub_table::do_write): Support fusion on ELFv2 stubs.
ld/testsuite/
* ld-powerpc/elfv2exe.d: Update for changed plt call stubs.

11 years agoFix gold plugin_test failures on PowerPC64 ELFv2
Alan Modra [Tue, 3 Jun 2014 01:17:55 +0000 (10:47 +0930)] 
Fix gold plugin_test failures on PowerPC64 ELFv2

readelf output for ELFv2 includes st_other bits specifying a
function's local entry offset.

* testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
st_other output.

11 years agoFix PowerPC64 ELFv2 icf_safe failures
Alan Modra [Sun, 1 Jun 2014 12:31:44 +0000 (22:01 +0930)] 
Fix PowerPC64 ELFv2 icf_safe failures

ELFv2 doesn't use .opd, so folding function code can't be allowed
in safe mode if a function's address might be taken.

* powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
Only ignore relocs on ELFv1.
(Target_powerpc::global_reloc_may_be_function_pointer): Likewise.

11 years agoFix testsuite to use newly-built linker for ehdr_start_test_4, and fix
Cary Coutant [Fri, 30 May 2014 17:21:27 +0000 (10:21 -0700)] 
Fix testsuite to use newly-built linker for ehdr_start_test_4, and fix
check script to look for the right binding.

gold/
* testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
* testsuite/Makefile.in: Regenerate.
* testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".

11 years agoFix "overflow in PLT unwind data" warning
Alan Modra [Thu, 15 May 2014 09:07:43 +0000 (18:37 +0930)] 
Fix "overflow in PLT unwind data" warning

When linking statically, it's possible to hit this warning with IFUNC
or very large executables, due to .glink being unused.

* powerpc.cc (do_plt_fde_location): Handle zero length .glink.
Compare FDE contents with DW_CFA_nop rather than 0.

11 years agoReferencing a function's address on PowerPC64 ELFv2
Alan Modra [Tue, 25 Mar 2014 04:42:48 +0000 (15:12 +1030)] 
Referencing a function's address on PowerPC64 ELFv2

ELFv2 needs to create plt entries in a non-PIC executable for an
address reference to a function defined in a shared object.  It's
possible that an object file has no features that distinguish it as
ELFv1 or ELFv2, eg. an object only containing data.  Such files need
to be handled like those that are known to be ELFv2.
However, this unnecessarily creates plt entries for the analogous
ELFv1 case, so arrange to set output abi version earlier, and use the
output abi version to further distinguish ambiguous input files.

bfd/
* elf64-ppc.c (ppc64_elf_check_relocs): Account for possibly
needed plt entries when taking the address of functions for
abiversion == 0 (ie. unknown) as well as abiversion == 2.
Move opd setup and abiversion checks to..
(ppc64_elf_before_check_relocs): ..here.  Renamed from
ppc64_elf_process_dot_syms.  Set output abiversion from input and
input abiversion from output, if either is not set.
(ppc64_elf_merge_private_bfd_data): Don't merge flags here.
(elf_backend_check_directives): Update.
ld/testsuite/
* ld-powerpc/startv1.s, * ld-powerpc/startv2.s, * ld-powerpc/funref.s,
* ld-powerpc/funv1.s, * ld-powerpc/funv2.s,
* ld-powerpc/ambiguousv1.d, * ld-powerpc/ambiguousv2.d: New test files.
* ld-powerpc/powerpc.exp: Run new tests.

11 years agoFix overflow handling of VLE_SDA21
Alan Modra [Fri, 14 Mar 2014 04:31:53 +0000 (15:01 +1030)] 
Fix overflow handling of VLE_SDA21

bfd/
* elf32-ppc.c (ppc_elf_relocate_section): Correct overflow
handling for VLE_SDA21 relocs.
ld/testsuite/
* ld-powerpc/vle.ld: Place .PPC.EMB.sdata0 within 32k of 0.
* ld-powerpc/vle-reloc-3.d: Update.

11 years agoBetter overflow checking for powerpc32 relocations
Alan Modra [Sat, 8 Mar 2014 02:35:06 +0000 (13:05 +1030)] 
Better overflow checking for powerpc32 relocations

Similar to the powerpc64 patch, this improves overflow checking in
elf32-ppc.c.  Many reloc "howto" entries needed fixes, some just
cosmetic.

The patch also fixes the R_PPC_VLE_SDA21 reloc application code, which
was horribly broken.  In fact, it may still be broken since Power ISA
2.07 says e_li behaves as
   RT <- EXTS(li20 1:4 || li20 5:8 || li20 0 || li20 9:19)
where li20 is a field taken from bits 17..20, 11..15, 21..31 of the
instruction.  Freescale VLEPEM says differently, and I assume
correctly, that
   RT <- EXTS(li20 0:3 || li20 4:8 || li20 9:19)
The VLE_SDA21 relocation description matches this too.

Now the VLE_SDA21 relocation specifies in the case where e_addi16 is
converted to e_li for symbols in .PPC.EMB.sdata0 or .PPC.EMB.sbss0
(no base register), that the field is restricted to 16 bits, with the
sign bit being propagated to the top 4 bits.  I don't see the sense in
restricting the value like this, so have allowed the full 20 bit
signed value.  This of course is compatible with the reloc description
in that values in the 16 bit signed range will result in exactly the
same insn field as when the reloc description is followed to the
letter.

* elf32-ppc.c (ppc_elf_howto_raw): Correct overflow check for
many relocations.  Correct bitsize and rightshift too for a number
of VLE relocs.  Describe R_PPC_VLE_SDA21 and R_PPC_VLE_SDA21_LO.
Correct dst_mask on R_PPC_VLE_SDA21_LO.
(ppc_elf_vle_split16): Tidy, delete unnecessary prototype.
(ppc_elf_relocate_section): Modify overflow test for 16-bit
fields in instructions to signed/unsigned according to whether
the field takes a signed or unsigned value.  Tidy vle split16 code.
Correct R_PPC_VLE_SDA21 and R_PPC_VLE_SDA21_LO handling.

11 years agoBetter overflow checking for powerpc64 relocations
Alan Modra [Thu, 6 Mar 2014 23:44:30 +0000 (10:14 +1030)] 
Better overflow checking for powerpc64 relocations

R_PPC64_ADDR16 is used in three contexts:
- .short data relocation
- 16-bit signed insn fields, eg. addi
- 16-bit unsigned insn fields, eg. ori
In the first case we want to allow both signed and unsigned 16-bit
values, the latter two ought to error if the field exceeds the range
of values allowed for 16-bit signed and unsigned integers
respectively.  These conflicting requirements meant that ld had to
choose the least restrictive overflow checks, and thus it is possible
to construct testcases where an addi field overflows but is not
reported by ld.  Many relocations dealing with 16-bit insn fields have
this problem.  What's more, some relocations that are only ever used
for signed fields of instructions woodenly copied the lax overflow
checking of R_PPC64_ADDR16.

bfd/
* elf64-ppc.c (ppc64_elf_howto_raw): Use complain_overflow_signed
for R_PPC64_ADDR14, R_PPC64_ADDR14_BRTAKEN, R_PPC64_ADDR14_BRNTAKEN,
R_PPC64_SECTOFF, R_PPC64_ADDR16_DS, R_PPC64_SECTOFF_DS,
R_PPC64_REL16 entries.  Use complain_overflow_dont for R_PPC64_TOC.
(ppc64_elf_relocate_section): Modify overflow test for 16-bit
fields in instructions to signed/unsigned according to whether
the field takes a signed or unsigned value.
gold/
* powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
(Powerpc_relocate_functions::has_overflow_unsigned): New function.
(Powerpc_relocate_functions::has_overflow_bitfield,
overflowed): Use the above.
(Target_powerpc::Relocate::relocate): Correct overflow checking
for a number of relocations.  Modify overflow test for 16-bit
fields in instructions to signed/unsigned according to whether
the field takes a signed or unsigned value.

11 years agoControl powerpc64-ld provision of register save/restore
Alan Modra [Wed, 19 Feb 2014 03:53:12 +0000 (14:23 +1030)] 
Control powerpc64-ld provision of register save/restore

This patch allows the user to override powerpc64-ld's default for
providing linker generated register save and restore functions as used
by gcc -Os code.  Normally these are not provided by ld -r, so Linux
kernel modules have needed to include their own copies.

bfd/
* elf64-ppc.h (struct ppc64_elf_params): Add save_restore_funcs.
* elf64-ppc.c (ppc64_elf_func_desc_adjust): Use it to control
provision of out-of-line register save/restore routines.
ld/
* emultempl/ppc64elf.em (params): Init new field.
(ppc_create_output_section_statements): Set params.save_restore_funcs
default.
(PARSE_AND_LIST_*): Add support for --save-restore-funcs and
--no-save-restore-funcs.

11 years agoConsolidate ppc64 ld/bfd communication
Alan Modra [Mon, 17 Feb 2014 06:38:00 +0000 (17:08 +1030)] 
Consolidate ppc64 ld/bfd communication

Moves assorted variables used to communicate between ld and bfd into
a struct, hooks it into the bfd link_hash_table early, and removes
all other places where such variables were passed piecemeal.

bfd/
* elf64-ppc.h (struct ppc64_elf_params): Define.
(ppc64_elf_init_stub_bfd, ppc64_elf_edit_opd, ppc64_elf_tls_setup,
ppc64_elf_setup_section_lists, ppc64_elf_size_stubs,
ppc64_elf_build_stubs): Update prototype.
* elf64-ppp.c (struct ppc_link_hash_table): Add params, delete other
fields now in params.  Adjust code throughout file.
(ppc64_elf_init_stub_bfd): Delete "abfd" parameter, add "params".
Save params pointer in htab.
(ppc64_elf_edit_opd, ppc64_elf_tls_setup,
ppc64_elf_setup_section_lists, ppc64_elf_size_stubs,
ppc64_elf_build_stubs): Remove parameters now in "params".
ld/
* emultemps/ppc64elf.em (params): New static struct replacing
various other static vars.  Adjust code throughout file.

11 years agoPR15530, mark symbol in executables if it matches dynamic_list
Alan Modra [Wed, 12 Feb 2014 10:38:01 +0000 (21:08 +1030)] 
PR15530, mark symbol in executables if it matches dynamic_list

For powerpc64 as HJ did earlier for other ELF targets, and a tidy.

PR gold/15530
* elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
--export-dynamic and --dynamic-list marking of symbols.
* elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Reorder
cheap tests first.

11 years agoMark symbol in executables if it matches dynamic_list
H.J. Lu [Thu, 6 Feb 2014 17:44:25 +0000 (09:44 -0800)] 
Mark symbol in executables if it matches dynamic_list

bfd/

PR gold/16530
* elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Mark symbol in
executables if it matches dynamic_list.

ld/testsuite/

PR gold/16530
* ld-elf/dynamic-1.c: New file.
* ld-elf/dynamic-1.rd: Likewise.
* ld-elf/dynamic-1.syms: Likewise.

* ld-elf/shared.exp (build_tests): Add dynamic-1.

11 years agoError on shared lib call to @local ifunc
Alan Modra [Mon, 13 Jan 2014 03:21:16 +0000 (13:51 +1030)] 
Error on shared lib call to @local ifunc

On powerpc32, making ifuncs have non-default visibility in shared
libraries or pies can result in runtime failures.  The problem is that
if gcc is told that a given function has non-default visibility, then
calls to that function are assumed to be local (which is true) and
thus need not go via a plt call stub (which is false for ifunc).  If
the caller has no other reason to set up the got pointer (r30), code
won't be emitted to do so.  However, a pic plt call stub makes use of
r30 to load the plt entry.  So a call to an ifunc, which always needs
a plt entry, will fail.

This patch makes ld emit an error for the problem case, and allows
calls to non-default visibility ifuncs to work in normal executables.
I also fix some cases where ifuncs fail when using the old bss-plt.

* elf32-ppc.c (ppc_elf_check_relocs): For @local call to ifunc,
error when shared and force a plt call otherwise.
(ppc_elf_size_dynamic_sections): Don't emit DT_PPC_GOT unless
plt_type == PLT_NEW.
(ppc_elf_relocate_section): Add missing test to resolve ifuncs to
the appropriate call stub.

11 years agodaily update
Alan Modra [Thu, 12 Jun 2014 00:00:17 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Wed, 11 Jun 2014 00:00:40 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Tue, 10 Jun 2014 00:00:17 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Mon, 9 Jun 2014 00:00:16 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Sun, 8 Jun 2014 00:00:18 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Sat, 7 Jun 2014 00:00:25 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Fri, 6 Jun 2014 00:00:21 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Thu, 5 Jun 2014 00:00:33 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Wed, 4 Jun 2014 00:00:20 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Tue, 3 Jun 2014 00:00:38 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Mon, 2 Jun 2014 00:00:18 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Sun, 1 Jun 2014 00:00:17 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Sat, 31 May 2014 00:00:19 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Fri, 30 May 2014 00:00:19 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Thu, 29 May 2014 00:00:34 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Wed, 28 May 2014 00:00:18 +0000 (09:30 +0930)] 
daily update

11 years agoProperly handle 64-bit GOT relocations
H.J. Lu [Tue, 27 May 2014 19:19:33 +0000 (12:19 -0700)] 
Properly handle 64-bit GOT relocations

This patch fixes 2 issues:

1. Since the GOT offset is always negative, we need to use signed int
to support 64-bit GOT relocations.
2. R_X86_64_PLTOFF64 uses the address of GLOBAL_OFFSET_TABLE, which is
the address of the .got.plt section, not the .got section.

PR gold/16945
* x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
for got_offset.  Properly get GOT address for R_X86_64_PLTOFF64.

11 years agodaily update
Alan Modra [Tue, 27 May 2014 00:00:33 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Mon, 26 May 2014 00:00:18 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Sun, 25 May 2014 00:00:19 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Sat, 24 May 2014 00:00:20 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Fri, 23 May 2014 00:00:31 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Thu, 22 May 2014 00:00:36 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Wed, 21 May 2014 00:00:34 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Tue, 20 May 2014 00:00:16 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Mon, 19 May 2014 00:00:16 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Sun, 18 May 2014 00:00:17 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Sat, 17 May 2014 00:00:18 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Fri, 16 May 2014 00:00:16 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Thu, 15 May 2014 00:00:18 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Wed, 14 May 2014 00:00:17 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Tue, 13 May 2014 00:00:18 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Mon, 12 May 2014 00:00:17 +0000 (09:30 +0930)] 
daily update

11 years ago2014-05-11 Chung-Lin Tang <cltang@codesourcery.com>
Chung-Lin Tang [Sun, 11 May 2014 17:09:47 +0000 (10:09 -0700)] 
2014-05-11  Chung-Lin Tang  <cltang@codesourcery.com>

Backport from master

2014-05-11  Chung-Lin Tang  <cltang@codesourcery.com>
* emulparams/nios2linux.sh (OTHER_GOT_SYMBOLS): Wrap _gp in HIDDEN(),
and gp in PROVIDE_HIDDEN.

11 years agodaily update
Alan Modra [Sun, 11 May 2014 00:00:17 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Sat, 10 May 2014 00:00:16 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Fri, 9 May 2014 00:00:18 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Thu, 8 May 2014 00:00:19 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Wed, 7 May 2014 00:00:28 +0000 (09:30 +0930)] 
daily update

11 years agoFix issue where first reserved word of GOT is not initialized if there
Cary Coutant [Tue, 6 May 2014 18:40:04 +0000 (11:40 -0700)] 
Fix issue where first reserved word of GOT is not initialized if there
is no PLT.

gold/
PR gold/16900
* i386.cc (Output_data_got_plt_i386): New class.
(Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
parameter. Change all callers.
(Output_data_plt_i386::layout_): Remove.
(Output_data_plt_i386::got_plt_): Change type.
(Target_i386::got_plt_): Change type. Change all references.
(Target_i386::got_section): Create instance of new class.
(Output_data_got_plt_i386::do_write): New function.
* x86_64.cc (Output_data_got_plt_x86_64): New class.
(Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
parameter. Change all callers.
(Output_data_plt_x86_64::layout_): Remove.
(Output_data_plt_x86_64::got_plt_): Change type.
(Target_x86_64::got_plt_): Change type. Change all references.
(Target_x86_64::got_section): Create instance of new class.
(Output_data_got_plt_x86_64::do_write): New function.
(Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
(Target_x86_64<size>::init_got_plt_for_update): Create instance of new
class.

11 years agoFix handling of __ehdr_start when it cannot be defined.
Cary Coutant [Wed, 2 Apr 2014 21:21:14 +0000 (14:21 -0700)] 
Fix handling of __ehdr_start when it cannot be defined.

gold/
* defstd.cc (in_segment): Define __ehdr_start here...
* layout.cc (Layout::finalize): ...Instead of here.  Set the
output segment when known.
* resolve.cc (Symbol::override_base_with_special): Remember
the original binding.
* symtab.cc (Symbol::set_output_segment): New function.
(Symbol::set_undefined): New function.
* symtab.h (Symbol::is_weak_undefined): Check original undef
binding.
(Symbol::is_strong_undefined): New function.
(Symbol::set_output_segment): New function.
(Symbol::set_undefined): New function.
* target-reloc.h (is_strong_undefined): Remove.
(issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
Check for hidden undefs.
(relocate_section): Call Symbol::is_strong_undefined.

* testsuite/Makefile.am (ehdr_start_test_1)
(ehdr_start_test_2, ehdr_start_test_3)
(ehdr_start_test_4, ehdr_start_test_5): New test cases.
* testsuite/Makefile.in: Regenerate.
* testsuite/ehdr_start_def.cc: New source file.
* testsuite/ehdr_start_test.cc: New source file.
* testsuite/ehdr_start_test.t: New linker script.
* testsuite/ehdr_start_test_4.sh: New shell script.

11 years agodaily update
Alan Modra [Tue, 6 May 2014 00:00:19 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Mon, 5 May 2014 00:00:16 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Sun, 4 May 2014 00:00:17 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Sat, 3 May 2014 00:00:20 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Fri, 2 May 2014 00:00:18 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Thu, 1 May 2014 00:00:16 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Wed, 30 Apr 2014 00:00:17 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Tue, 29 Apr 2014 00:00:19 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Mon, 28 Apr 2014 00:00:30 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Sun, 27 Apr 2014 00:00:31 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Sat, 26 Apr 2014 00:00:30 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Fri, 25 Apr 2014 00:00:30 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Thu, 24 Apr 2014 00:00:21 +0000 (09:30 +0930)] 
daily update

11 years agoAdd missing break statement for case elfcpp::R_X86_64_PLTOFF64.
Cary Coutant [Wed, 23 Apr 2014 22:17:16 +0000 (15:17 -0700)] 
Add missing break statement for case elfcpp::R_X86_64_PLTOFF64.

gold/
PR gold/16870
* x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.

11 years agodaily update
Alan Modra [Wed, 23 Apr 2014 00:00:33 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Tue, 22 Apr 2014 00:00:18 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Mon, 21 Apr 2014 00:00:15 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Sun, 20 Apr 2014 00:00:18 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Sat, 19 Apr 2014 00:00:29 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Fri, 18 Apr 2014 00:00:18 +0000 (09:30 +0930)] 
daily update

11 years agodaily update
Alan Modra [Thu, 17 Apr 2014 00:00:39 +0000 (09:30 +0930)] 
daily update

11 years agofill ppc476 fixup area
Alan Modra [Wed, 16 Apr 2014 02:17:13 +0000 (11:47 +0930)] 
fill ppc476 fixup area

Stops false positive warnings from scanner.

* elf32-ppc.c (ppc_elf_relocate_section): Fill 476 fixup area
with "ba 0" rather than zeros.

11 years agoppc476 plt call stubs
Alan Modra [Mon, 14 Apr 2014 02:18:06 +0000 (11:48 +0930)] 
ppc476 plt call stubs

Fuss over bctr in call stubs.

* elf32-ppc.c (BA): Define
(ppc_elf_link_hash_table_create): Correct default_params.
(write_glink_stub): Pad small plt call stub with "ba 0" rather
than "nop" for ppc476_workaround.
(ppc_elf_finish_dynamic_sections): Likewise for branch table
and __glink_PLTresolve.  Ensure plt call stub at end of page
doesn't allow fall-thru prefetch.

11 years agoppc476 gas warn on data in code sections
Alan Modra [Wed, 9 Apr 2014 08:13:21 +0000 (17:43 +0930)] 
ppc476 gas warn on data in code sections

     * config/tc-ppc.c (warn_476, last_insn, last_seg, last_subseg):
     New static vars.
     (md_longopts, md_parse_option, md_show_usage): Add --ppc476-workaround.
     (ppc_elf_cons_fix_check): New function.
     (md_assemble): Set last_insn, last_seg, last_subseg.
     (ppc_elf_cons, ppc_byte, md_apply_fix): Handle warn_476.
     * config/tc-ppc.h (TC_CONS_FIX_CHECK): Define.
     (ppc_elf_cons_fix_check): Declare.
     * read.c (cons_worker): Invoke TC_CONS_FIX_CHECK.

11 years agoppc476 icache workaround fix for bctr
Alan Modra [Sat, 5 Apr 2014 07:13:36 +0000 (17:43 +1030)] 
ppc476 icache workaround fix for bctr

I got the ppc476 workaround wrong.  bctr (and bctrl) as the last
instruction in a page can hit the icache bug if the preceding mtctr
insn is close by, and the destination is in the first few instructions
on the next page.  This scenario can occur with code generated by gcc
to implement switch statements, or in code generated to call by
function pointer.

To prevent the bctr problem it is also necessary to remove other
instructions that otherwise would be safe.

bfd/
* elf32-ppc.c (ppc_elf_relocate_section): Remove bctr from list
of safe ppc476 insns at end of page.  Also remove non-branch insns.
Expand comments.
ld/
* emultempl/ppc32elf.em (no_zero_padding, ppc_finish): New functions.
(LDEMUL_FINISH): Define.

11 years agoFix ELF ppc32 targets that don't use ppc32elf.em
Alan Modra [Thu, 27 Feb 2014 13:01:35 +0000 (23:31 +1030)] 
Fix ELF ppc32 targets that don't use ppc32elf.em

5446cbdf82892a800ed7eef563a795e75223ec52 broke powerpc-lynxos,
powerpc-netware, powerpc-windiss and powerpc-vxworks.

bfd/
* elf32-ppc.c (ppc_elf_link_hash_table_create): Provide default
params for targets that don't use ppc32elf.em.
ld/
* emulparams/elf32ppcvxworks.sh: Source plt_unwind.sh and
use ppc32elf.em.
* emultempl/ppc32elf.em (ppc_after_open): Don't compile for
vxworks.
(LDEMUL_AFTER_OPEN): Don't set for vxworks.
(PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS): Exclude
-secure-plt, -bss-plt and -sdata-got when vxworks.

11 years agoAdd ppc476 workaround bootstrap test
Alan Modra [Thu, 20 Feb 2014 23:48:01 +0000 (10:18 +1030)] 
Add ppc476 workaround bootstrap test

I was running this by hand to test out --ppc476-workaround.  Another
bootstrap test doesn't take all that long, so let's add it to the
testsuite.

* ld-bootstrap/bootstrap.exp: Add ppc476 workaround test.
* ld-bootstrap/ppc476.t: New file.

11 years agoppc476 workaround for ld -r fixes
Alan Modra [Mon, 17 Feb 2014 06:21:25 +0000 (16:51 +1030)] 
ppc476 workaround for ld -r fixes

This fixes the glaring error that the ppc476 workaround wasn't
actually enabled for ld -r, and adjusts relocations to match moved
code.

bfd/
* elf32-ppc.c (ppc_elf_relocate_section): Move relocs on insns
patched for ppc476 workaround.  Reapply branch taken/not taken
relocs.
ld/
* emultempl/ppc32elf.em (ppc_after_open_output): Really enable
ppc476 workaround for ld -r.

11 years agoEnable ppc476 workaround for ld -r.
Alan Modra [Wed, 12 Feb 2014 06:14:36 +0000 (16:44 +1030)] 
Enable ppc476 workaround for ld -r.

The Linux kernel builds modules using ld -r.  These might need the
ppc476 workaround, so enable it for ld -r if sections have sufficient
alignment to tell location within a page.

bfd/
* elf32-ppc.c (ppc_elf_relax_section): Enable ppc476 workaround
for ld -r, when code sections are sufficiently aligned.
* elf32-ppc.h (struct ppc_elf_params): Delete pagesize.  Add
pagesize_p2.
ld/
* emultempl/ppc32elf.em (pagesize): New static var.
(ppc_after_open_output): Set params.pagesize_p2 from pagesize.
(PARSE_AND_LIST_ARGS_CASES): Adjust to use pagesize.

11 years agoppc476 icache bug workaround
Alan Modra [Wed, 29 Jan 2014 21:56:02 +0000 (08:26 +1030)] 
ppc476 icache bug workaround

This implements a work-around for an icache bug on 476 that can cause
execution of stale instructions when control falls through from one
page to the next.  The idea is to prevent such fall-through by
replacing the last instruction on a page with a branch to a patch
area containing the instruction, then branch to the next page.

The patch also fixes a number of bugs in the existing support for long
branch trampolines.

bfd/
* elf32-ppc.c (struct ppc_elf_link_hash_table): Add params.
Delete emit_stub_syms, no_tls_get_addr_opt.  Update all uses.
(ppc_elf_link_params): New function.
(ppc_elf_create_glink): Align .glink to 64 bytes for ppc476
workaround.
(ppc_elf_select_plt_layout): Remove plt_style and emit_stub_syms
parameters.  Use htab->params instead.
(ppc_elf_tls_setup): Remove no_tls_get_addr_opt parameter.
(ppc_elf_size_dynamic_sections): Align __glink_PLTresolve to
64 bytes for ppc476 workaround.
(struct ppc_elf_relax_info): New.
(ppc_elf_relax_section): Exclude linker created sections and
those too small to hold one instruction.  Don't add another
branch  around trampolines on later relax passes.  Don't
generate trampolines for undefined symbols when !relocatable,
nor for plugin symbols.  Allocate space for ppc476 workaround
patch area.  Free fixups on error return path.
(ppc_elf_relocate_section): Handle ppc476 workaround patching.
* elf32-ppc.h (struct ppc_elf_params): New.
(ppc_elf_select_plt_layout, ppc_elf_tls_setup): Update prototype.
(ppc_elf_link_params): Declare.
* section.c (SEC_INFO_TYPE_TARGET): Define.
* bfd-in2.h: Regenerate.
ld/
* emultempl/ppc32elf.em (no_tls_get_addr_opt, emit_stub_syms)
plt_style): Delete.  Adjust all refs to instead use..
(params): ..this.  New variable.
(ppc_after_open_output): New function.  Tweak params and pass to
ppc_elf_link_params.
(ppc_after_open): Adjust ppc_elf_select_plt_layout call.
(ppc_before_allocation): Adjust ppc_elf_tls_setup call.  Enable
relaxation for ppc476 workaround.
(PARSE_AND_LIST_*): Add --{no-,}ppc476-workaround support.
(LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS): Define.

11 years agodaily update
Alan Modra [Wed, 16 Apr 2014 00:00:29 +0000 (09:30 +0930)] 
daily update

11 years ago[AArch64] Fix off by one error in instruction relaxation mask.
Marcus Shawcroft [Tue, 15 Apr 2014 16:46:07 +0000 (17:46 +0100)] 
[AArch64] Fix off by one error in instruction relaxation mask.

The AArch64 TLSDESC to IE relaxation code uses a bit mask intended to
ensure that destination register in a relaxed ldr instruction is
always X0.  The mask has an off by one error resulting in the most
significant bit of the destination register being retained in the
relaxed instruction.  The issue generally appears when the compiler
emits TLS accesses code under high register pressure resulting in a
broken code sequence.

11 years agodaily update
Alan Modra [Tue, 15 Apr 2014 00:00:21 +0000 (09:30 +0930)] 
daily update