[Bug ld/11088] Internal Error in ppc64_elf_gc_sweep_hook

2009-12-16 Thread amodra at bigpond dot net dot au

--- Additional Comments From amodra at bigpond dot net dot au  2009-12-16 
23:34 ---
Found it.  The symbol in question is hidden.  check_relocs records a need for a
plt entry ok, but then we hit code after this comment in elflink.c
/* If the symbol already has a dynamic index, but
   visibility says it should not be visible, turn it into
   a local symbol.  */
So elf_backend_hide_symbol zaps the plt entry.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11088

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


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


[Bug ld/11088] Internal Error in ppc64_elf_gc_sweep_hook

2009-12-16 Thread cvs-commit at gcc dot gnu dot org

--- Additional Comments From cvs-commit at gcc dot gnu dot org  2009-12-17 
00:07 ---
Subject: Bug 11088

CVSROOT:/cvs/src
Module name:src
Changes by: amo...@sourceware.org   2009-12-17 00:07:38

Modified files:
bfd: ChangeLog elf64-ppc.c 

Log message:
PR ld/11088
* elf64-ppc.c (ppc64_elf_gc_sweep_hook): Don't abort if symbol
hiding has nulled out plt.plist.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=srcr1=1.4862r2=1.4863
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/elf64-ppc.c.diff?cvsroot=srcr1=1.304r2=1.305



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11088

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


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


[Bug gas/11102] New: AVR gs() operator cant be used in simple expressions

2009-12-16 Thread hutchinsonandy at gcc dot gnu dot org
AVR target uses the GAS gs() operator'
On smaller devices  it simply provides a word address.
On large devices 64K words such as -mmcu=avr6 it creates trampoline jump table
entry and return its location. This allows 16bit addressing to access 24bit
space of large memory devices.


However, the gs() cannot be used within another operator - for example

ldi r24,lo8(2+gs(test_func))

will give:

test.s:44: Error: `)' required
test.s:44: Error: garbage at end of line

This currently (4.5 head) prevent avr-gcc using any simple pointer arithmetic.

Depening on code and optimization, gcc may create constant or evaluated
expression for pointers manipulations such as

 void (* x) (void);
 x = test_func;
 x= x + 2;

which may be optimized into

x = (test_func+2);


which can be passed to gas as gs(test_func+2) or gs(test_func) with +2 done by
assembler instructions

However, there are two problems:

First is that gs() returns word address - thus it should be gs(test_func+4).  I
can hack avr-gcc backend to take care of this and then at least pointer
arithmetic work for smaller devices.

The second unsolvable problem applies to large devices -mmcu=avr6 where
trampolines are created by gs().

The above example will create trampoline entries to jump to(test_func+2) or
(test_func) depending on optimization level. What we really need is to always
create trampoline entry for test_func and then add 2. eg

ldi r24,lo8(2+gs(test_func))

avr-gcc can be modified to create this format - unfortunately gas wont take it -
preventing any pointer arithmetic from being used on avr6 device type.

-- 
   Summary: AVR gs()  operator cant be used in simple expressions
   Product: binutils
   Version: unspecified
Status: NEW
  Severity: normal
  Priority: P2
 Component: gas
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: hutchinsonandy at gcc dot gnu dot org
CC: bug-binutils at gnu dot org
GCC target triplet: avr-*-*


http://sourceware.org/bugzilla/show_bug.cgi?id=11102

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


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


[Bug ld/11088] Internal Error in ppc64_elf_gc_sweep_hook

2009-12-16 Thread cvs-commit at gcc dot gnu dot org

--- Additional Comments From cvs-commit at gcc dot gnu dot org  2009-12-17 
05:45 ---
Subject: Bug 11088

CVSROOT:/cvs/src
Module name:src
Changes by: amo...@sourceware.org   2009-12-17 05:45:26

Modified files:
include/elf: ChangeLog ppc.h 
bfd: ChangeLog elf32-ppc.c 

Log message:
PR ld/11088
include/elf/
* ppc.h (R_PPC_RELAX32, R_PPC_RELAX32PC, R_PPC_RELAX32_PLT,
R_PPC_RELAX32PC_PLT): Delete.
(R_PPC_RELAX, R_PPC_RELAX_PLT, R_PPC_RELAX_PLTREL24): Define.
bfd/
* elf32-ppc.c (update_plt_info): Clear sec here when addend is
less than 32768..
(ppc_elf_check_relocs): ..rather than doing so here.  Ignore new
relax relocs.
(ppc_elf_gc_sweep_hook): Don't segfault when symbol hiding has
removed plt_entry records.
(ppc_elf_tls_setup): Handle PIE calls to __tls_get_addr correctly.
(ppc_elf_tls_optimize): Likewise.  Also dec __tls_get_addr refcount
when optimizing code using new tlsgd and tlsld marker relocs.
(ppc_elf_relax_section): Differentiate relaxed PLTREL24 relocs
from ADDR24 relocs using plt or glink.  Don't clear the addend
for R_PPC_RELAX_PLTREL24.
(ppc_elf_relocate_section): Correctly handle addends on relaxed
PLTREL24 relocs.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/include/elf/ChangeLog.diff?cvsroot=srcr1=1.383r2=1.384
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/include/elf/ppc.h.diff?cvsroot=srcr1=1.26r2=1.27
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=srcr1=1.4863r2=1.4864
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/elf32-ppc.c.diff?cvsroot=srcr1=1.272r2=1.273



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11088

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


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


[Bug ld/11088] Internal Error in ppc64_elf_gc_sweep_hook

2009-12-16 Thread cvs-commit at gcc dot gnu dot org

--- Additional Comments From cvs-commit at gcc dot gnu dot org  2009-12-17 
05:46 ---
Subject: Bug 11088

CVSROOT:/cvs/src
Module name:src
Branch: binutils-2_20-branch
Changes by: amo...@sourceware.org   2009-12-17 05:46:06

Modified files:
include/elf: ChangeLog ppc.h 
bfd: ChangeLog elf32-ppc.c 

Log message:
PR ld/11088
include/elf/
* ppc.h (R_PPC_RELAX32, R_PPC_RELAX32PC, R_PPC_RELAX32_PLT,
R_PPC_RELAX32PC_PLT): Delete.
(R_PPC_RELAX, R_PPC_RELAX_PLT, R_PPC_RELAX_PLTREL24): Define.
bfd/
* elf32-ppc.c (update_plt_info): Clear sec here when addend is
less than 32768..
(ppc_elf_check_relocs): ..rather than doing so here.  Ignore new
relax relocs.
(ppc_elf_gc_sweep_hook): Don't segfault when symbol hiding has
removed plt_entry records.
(ppc_elf_tls_setup): Handle PIE calls to __tls_get_addr correctly.
(ppc_elf_tls_optimize): Likewise.  Also dec __tls_get_addr refcount
when optimizing code using new tlsgd and tlsld marker relocs.
(ppc_elf_relax_section): Differentiate relaxed PLTREL24 relocs
from ADDR24 relocs using plt or glink.  Don't clear the addend
for R_PPC_RELAX_PLTREL24.
(ppc_elf_relocate_section): Correctly handle addends on relaxed
PLTREL24 relocs.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/include/elf/ChangeLog.diff?cvsroot=srconly_with_tag=binutils-2_20-branchr1=1.379.2.1r2=1.379.2.2
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/include/elf/ppc.h.diff?cvsroot=srconly_with_tag=binutils-2_20-branchr1=1.25.4.1r2=1.25.4.2
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=srconly_with_tag=binutils-2_20-branchr1=1.4761.2.34r2=1.4761.2.35
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/elf32-ppc.c.diff?cvsroot=srconly_with_tag=binutils-2_20-branchr1=1.267.2.3r2=1.267.2.4



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11088

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


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