[Bug ld/16548] New: Ld does not handle arbitrary .plt/.got displacements

2014-02-10 Thread y.gribov at samsung dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16548

Bug ID: 16548
   Summary: Ld does not handle arbitrary .plt/.got displacements
   Product: binutils
   Version: 2.25 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: y.gribov at samsung dot com

Currently BFD linker generates 3-word wide .plt entries for ARM targets:

825c <.plt>:
...
8270: e28fc600 add ip, pc, #0, 12
8274: e28cca08 add ip, ip, #8, 20 ; 0x8000
8278: e5bcf3e8 ldr pc, [ip, #1000]! ; 0x3e8
827c: e28fc600 add ip, pc, #0, 12
8280: e28cca08 add ip, ip, #8, 20 ; 0x8000
8284: e5bcf3e0 ldr pc, [ip, #992]! ; 0x3e0

These entries are only able to initialize first 28 bits of .plt/.got
displacement. If .text and .rodata are bigger than 2 ^ 28 bytes (i.e. 256M)
this may cause linker errors due to assert in elf32_arm_populate_plt_entry (in
bfd/elf32-arm.c):

BFD_ASSERT ((got_displacement & 0xf000) == 0);

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/16548] Ld does not handle arbitrary .plt/.got displacements

2014-02-10 Thread y.gribov at samsung dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16548

Yury Gribov  changed:

   What|Removed |Added

 CC||v.garbuzov at samsung dot com,
   ||y.gribov at samsung dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/16548] Ld does not handle arbitrary .plt/.got displacements

2014-02-10 Thread y.gribov at samsung dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16548

--- Comment #1 from Yury Gribov  ---
Created attachment 7401
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7401&action=edit
Proposed patch

I suggest to add an option --long-plt to allow generation of 4-word wide
.plt entries capable of handling arbitrary .plt/.got displacements:

825c <.plt>:
...
8270: e28fc200 add ip, pc, #0, 4
8274: e28cc600 add ip, ip, #0, 12
8278: e28cca08 add ip, ip, #8, 20 ; 0x8000
827c: e5bcf3f4 ldr pc, [ip, #1012]! ; 0x3f4
8280: e28fc200 add ip, pc, #0, 4
8284: e28cc600 add ip, ip, #0, 12
8288: e28cca08 add ip, ip, #8, 20 ; 0x8000
828c: e5bcf3e8 ldr pc, [ip, #1000]! ; 0x3e8

Users will than be able to avoid afore-mentioned link error by compiling
with -Wl,--long-plt.

I'm attaching a draft patch to illustrate my proposal.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/16533] Gold does not set HASENTRY attribute on ARM

2014-02-10 Thread y.gribov at samsung dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16533

Yury Gribov  changed:

   What|Removed |Added

 CC||v.garbuzov at samsung dot com,
   ||y.gribov at samsung dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/16548] Ld does not handle arbitrary .plt/.got displacements

2014-02-10 Thread y.gribov at samsung dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16548

--- Comment #2 from Yury Gribov  ---
Link to discussion in mailing list:
https://sourceware.org/ml/binutils/2014-02/msg00053.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/16530] --dynamic-list does not protect symbols from being garbage collected

2014-02-10 Thread cvs-commit at gcc dot gnu.org
http://sourceware.org/bugzilla/show_bug.cgi?id=16530

--- Comment #3 from cvs-commit at gcc dot gnu.org  ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, master has been updated
   via  d6f6f455778b10037503bcc39352b5174bba5e45 (commit)
  from  8577303939d47fc3dd433ed31f78ee47c6ad0aa8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d6f6f455778b10037503bcc39352b5174bba5e45

commit d6f6f455778b10037503bcc39352b5174bba5e45
Author: H.J. Lu 
Date:   Thu Feb 6 09:44:25 2014 -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.

---

Summary of changes:
 bfd/ChangeLog  |6 ++
 bfd/elflink.c  |6 +-
 ld/testsuite/ChangeLog |9 +
 ld/testsuite/ld-elf/dynamic-1.c|   10 ++
 ld/testsuite/ld-elf/dynamic-1.rd   |5 +
 ld/testsuite/ld-elf/dynamic-1.syms |3 +++
 ld/testsuite/ld-elf/shared.exp |3 +++
 7 files changed, 41 insertions(+), 1 deletions(-)
 create mode 100644 ld/testsuite/ld-elf/dynamic-1.c
 create mode 100644 ld/testsuite/ld-elf/dynamic-1.rd
 create mode 100644 ld/testsuite/ld-elf/dynamic-1.syms

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils