Re: ld segfault -> NULL pointer dereference in bfd/elf32-ppc.c
On Mon, Dec 07, 2009 at 10:30:15AM +0100, Adrien Demarez wrote: > I experience an ld segfault when trying to compile QT4.6 in > OpenEmbedded/Angstrom for the PPC platform (MPC8313 more precisely). The > following patch (against the CVS version) solves this : after having a > look at the core file, the return value from find_plt_ent() is not > checked in several points, leading to a NULL pointer dereference in some > situations. I have just committed a patch that should fix this problem. http://sourceware.org/ml/binutils/2009-12/msg00231.html -- Alan Modra Australia Development Lab, IBM ___ 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
--- Additional Comments From amodra at bigpond dot net dot au 2009-12-17 05:48 --- Fixed -- What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED 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
--- 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=src&only_with_tag=binutils-2_20-branch&r1=1.379.2.1&r2=1.379.2.2 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/include/elf/ppc.h.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.25.4.1&r2=1.25.4.2 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.4761.2.34&r2=1.4761.2.35 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/elf32-ppc.c.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.267.2.3&r2=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
[Bug ld/11088] Internal Error in ppc64_elf_gc_sweep_hook
--- 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=src&r1=1.383&r2=1.384 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/include/elf/ppc.h.diff?cvsroot=src&r1=1.26&r2=1.27 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&r1=1.4863&r2=1.4864 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/elf32-ppc.c.diff?cvsroot=src&r1=1.272&r2=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 gas/11102] New: AVR gs() operator cant be used in simple expressions
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
--- Additional Comments From cvs-commit at gcc dot gnu dot org 2009-12-17 00:08 --- Subject: Bug 11088 CVSROOT:/cvs/src Module name:src Branch: binutils-2_20-branch Changes by: amo...@sourceware.org 2009-12-17 00:08:01 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=src&only_with_tag=binutils-2_20-branch&r1=1.4761.2.33&r2=1.4761.2.34 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/elf64-ppc.c.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.299.2.3&r2=1.299.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
[Bug ld/11088] Internal Error in ppc64_elf_gc_sweep_hook
--- 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=src&r1=1.4862&r2=1.4863 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/elf64-ppc.c.diff?cvsroot=src&r1=1.304&r2=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 ld/11088] Internal Error in ppc64_elf_gc_sweep_hook
--- 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 gas/11058] xgcc: Internal error: Segmentation fault (program as)
--- Additional Comments From mark at advancedtechcorp dot com 2009-12-16 21:25 --- (In reply to comment #2) > Please look at your config.log, recreate conftest.c from the log, and run the > command that failed but add -v to the command line. This will tell us the > version of the assembler being run. My bad. Wrong assembler. Please close. -- What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID http://sourceware.org/bugzilla/show_bug.cgi?id=11058 --- 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