[Bug ld/3869] New: The mapping behavior for small data of the ld for PowerPC, from COMMON section to bss section.
Hello, By using ld for PowerPC, a small size variable in the COMMON section is mapped to the bss section. But By using ld for MIPS, a small size variable in the COMMON section is mapped to the sbss section. I think the behavior of the ld for MIPS is correct, and PowerPC's is something wrong. Below is a sample code. /*** a.h ***/ extern int a1[1]; int b( void ); /*** a.c ***/ #include "a.h" int a1[1]; void __start() { b(); } /*** b.c ***/ #include "a.h" int b( void ) { if (a1[1] == 0) { return 0; } return 1; } /*** mk.rc */ #!/bin/sh export LANG=C ### powerpc ### ppcgcc="/work/te/tool/build/gnu/gcc-4.1.1-linux/Linux-i686.ppclinux/./gcc/xgcc" ppcgcc="$ppcgcc -B/work/te/tool/build/gnu/gcc-4.1.1-linux/Linux-i686.ppclinux/./gcc/" ppcgcc="$ppcgcc -B/work/te/tool/Linux-i686.ppclinux/powerpc-unknown-linux/bin/" $ppcgcc -msdata=sysv -G 8 -c -o a.ppc.o a.c $ppcgcc -msdata=sysv -G 8 -c -o b.ppc.o b.c $ppcgcc -msdata=sysv -G 8 -r -Wl,-d -nostdlib -o c.ppc.out a.ppc.o b.ppc.o ppcobjdump="/work/te/tool/Linux-i686.ppclinux/bin/powerpc-unknown-linux-objdump" $ppcobjdump --all-headers a.ppc.o > a.ppc.o.odp $ppcobjdump --disassemble a.ppc.o >> a.ppc.o.odp $ppcobjdump --all-headers b.ppc.o > b.ppc.o.odp $ppcobjdump --disassemble b.ppc.o >> b.ppc.o.odp $ppcobjdump --all-headers c.ppc.out > c.ppc.out.odp $ppcobjdump --disassemble c.ppc.out >> c.ppc.out.odp ### mips ### mipsgcc="/work/te/tool/build/gnu/gcc-4.1.1-linux/Linux-i686.mipslinux/./gcc/xgcc" mipsgcc="$mipsgcc -B/work/te/tool/build/gnu/gcc-4.1.1-linux/Linux-i686.mipslinux/./gcc/" mipsgcc="$mipsgcc -B/work/te/tool/Linux-i686.mipslinux/mips64el-unknown-linux/bin/" $mipsgcc -O1 -c -o a.mips.o a.c $mipsgcc -O1 -c -o b.mips.o b.c $mipsgcc -O1 -r -Wl,-d -nostdlib -o c.mips.out a.mips.o b.mips.o mipsobjdump="/work/te/tool/Linux-i686.mipslinux/bin/mips64el-unknown-linux-objdump" $mipsobjdump --all-headers a.mips.o > a.mips.o.odp $mipsobjdump --disassemble a.mips.o >> a.mips.o.odp $mipsobjdump --all-headers b.mips.o > b.mips.o.odp $mipsobjdump --disassemble b.mips.o >> b.mips.o.odp $mipsobjdump --all-headers c.mips.out > c.mips.out.odp $mipsobjdump --disassemble c.mips.out >> c.mips.out.odp $ppcgcc -v $mipsgcc -v /***/ Below is the result of the execution of "mk.rc". /***/ [EMAIL PROTECTED]:/work/test/scomm/$ ./mk.rc Reading specs from /work/te/tool/build/gnu/gcc-4.1.1-linux/Linux-i686.ppclinux/./gcc/specs Target: powerpc-unknown-linux Configured with: ../gcc-4.1.1/configure --prefix=/work/te/tool/Linux-i686.ppclinux --target=powerpc-unknown-linux --enable-languages=c --enable-threads=no Thread model: single gcc version 4.1.1 Reading specs from /work/te/tool/build/gnu/gcc-4.1.1-linux/Linux-i686.mipslinux/./gcc/specs Target: mips64el-unknown-linux Configured with: ../gcc-4.1.1/configure --prefix=/work/te/tool/Linux-i686.mipslinux --target=mips64el-unknown-linux --enable-languages=c --enable-threads=no Thread model: single gcc version 4.1.1 [EMAIL PROTECTED]:/work/test/scomm/$ /***/ Below is the output files for PowerPC. / a.ppc.o.odp **/ SYMBOL TABLE: . 0004 O *COM* 0004 a1 / b.ppc.o.odp **/ SYMBOL TABLE: . *UND* a1 RELOCATION RECORDS FOR [.text]: OFFSET TYPE VALUE 000e R_PPC_SDAREL16a1+0x0004 Disassembly of section .text: : 0: 94 21 ff e0 stwur1,-32(r1) 4: 93 e1 00 1c stw r31,28(r1) 8: 7c 3f 0b 78 mr r31,r1 c: 80 0d 00 04 lwz r0,4(r13) 10: 2f 80 00 00 cmpwi cr7,r0,0 14: 40 9e 00 10 bne-cr7,24 . . / c.ppc.out.odp **/ SYMBOL TABLE: . ldf *ABS* b.c 0030 g F .text 0044 b g O .bss 0004 a1 <= .sbss g F .text 0030 __start RELOCATION RECORDS FOR [.text]: OFFSET TYPE VALUE 0014 R_PPC_REL24 b 003e R_PPC_SDAREL16a1+0x0004 Disassembly of section .text: <__start>: 0: 94 21 ff f0 stwur1,-16(r1) . 0030 : 30: 94 21 ff e0 stwur1,-32(r1) 34: 93 e1 00 1c stw r31,28(r1) 38: 7c 3f 0b 78 mr r31,r1 3c: 80 0d 00 04 lwz r0,4(r13) 40: 2f 80 00 00 cmpwi cr7,r0,0 44: 40 9e 00 10 bne-cr7,54 . /***/ Below is the output files for MIPS. / a.mips.o.odp **/ SYMBOL TABLE: . 0004 O *COM* 0008 a1 / b.mips.o.odp **/ SYMBOL TABLE: . g F .text
[Bug gas/3871] New: Score assembler passes stack meory around
tc-score.c has if (value == (int) FAIL) { char err_msg[100]; if ((data_type != _SIMM14_NEG) && (data_type != _SIMM16_NEG) && (data_type != _IMM16_NEG)) { sprintf (err_msg, "invalid constant: %d bit expression not in range %d..%d", score_df_range[data_type].bits, score_df_range[data_type].range[0], score_df_range[data_type].range[1]); } else { sprintf (err_msg, "invalid constant: %d bit expression not in range %d..%d", score_df_range[data_type].bits, -score_df_range[data_type].range[1], -score_df_range[data_type].range[0]); } inst.error = _(err_msg); return (int) FAIL; } There are 2 problems: 1. inst.error is pointed to a stack memory and used later to report an error. It is a very bad idea. 2. _() is used on a variable. Shouldn't it be used on a string constant? -- Summary: Score assembler passes stack meory around Product: binutils Version: unspecified Status: NEW Severity: normal Priority: P2 Component: gas AssignedTo: unassigned at sources dot redhat dot com ReportedBy: hjl at lucon dot org CC: bug-binutils at gnu dot org GCC target triplet: score-unknown-elf http://sourceware.org/bugzilla/show_bug.cgi?id=3871 --- 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
The user to choose
Harris Exploration Hits Gold! Inner origin from the survey site say that HXPN has made a major discovery. Word is that results show a 12.5 gm/T rating on the property. With onsite fittings able to process 100 tons a day it equates to yields of 1250 gm/day. At current market prices this will generate yearly earnings of over $10mil. Taking into attention both the size and the high soil ratings this gives Harris Exploration a book price of roughly $5.00 which we have pegged as our target price. Harris Exploration Symbol: HXPN Last Price: $1.62 Sho rt Term Tar get: $5.00 This news will hit the street very soon and send this symbol flying. We council our readers to get in now and divest at the tar get price.Recomme\ndation: think ___ Bug-bayonne mailing list [EMAIL PROTECTED] http://lists.gnu.org/mailman/listinfo/bug-bayonne
[Bug binutils/3874] New: linker crashes with -m avr2 --oformat ihex
Using any simple test program, do this on a 32bit host (64bit hosts tend not to crash reliably here) $ avr-gcc -mmcu=attiny2313 avr_test.c -c $ avr-ld -m avr2 -o avr_test.hex /opt/cross/avr/lib/crttn2313.o --oformat ihex avr_test.o BFD 2.17.50.0.8 20061201 internal error, aborting at ../../bfd/linker.c line 2397 in set_symbol_from_hash I tracked that back to one specific patch added in August 2006: cvs -d :pserver:[EMAIL PROTECTED]:/cvs/src co -D '2006-10-17 15:41' binutils - is good cvs -d :pserver:[EMAIL PROTECTED]:/cvs/src co -D '2006-10-17 15:42' binutils - crashes. The Changelog of the patch has this: diff -u -r1.3635 -r1.3636 --- bfd/ChangeLog 16 Oct 2006 17:21:44 - 1.3635 +++ bfd/ChangeLog 17 Oct 2006 13:41:46 - 1.3636 @@ -1,3 +1,55 @@ +2006-10-17 Alan Modra <[EMAIL PROTECTED]> + + * elf-bfd.h (struct elf_link_hash_table): Reorder. Add + text_index_section and data_index_section. + (struct elf_backend_data): Add elf_backend_init_index_section. + (_bfd_elf_init_1_index_section): Declare. + (_bfd_elf_init_2_index_sections): Declare. + * elfxx-target.h (elf_backend_init_index_section): Define. + (elfNN_bed): Init new field. + * elflink.c (_bfd_elf_link_omit_section_dynsym): Keep first tls + section and text_index_section plus data_index_section. + (_bfd_elf_link_renumber_dynsyms): Clear dynindx on omitted sections. + (_bfd_elf_init_1_index_section): New function. + (_bfd_elf_init_2_index_sections): New function. + (bfd_elf_size_dynsym_hash_dynstr): Call elf_backend_init_index_section. + (elf_link_input_bfd): When emitting relocs, use text_index_section + and data_index_section for removed sections. + * elf-m10300.c (elf_backend_omit_section_dynsym): Define. + * elf32-i386.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-sh.c: Likewise. ... elf32-avr.c is not in the list. Can someone please help extending this patch to cover also avr targets? Thanks, Jw. -- Summary: linker crashes with -m avr2 --oformat ihex Product: binutils Version: 2.18 (HEAD) Status: NEW Severity: normal Priority: P2 Component: binutils AssignedTo: unassigned at sources dot redhat dot com ReportedBy: jw at suse dot de CC: amodra at bigpond dot net dot au,bug-binutils at gnu dot org GCC target triplet: cross-avr-binutils http://sourceware.org/bugzilla/show_bug.cgi?id=3874 --- 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 binutils/3874] linker crashes with -m avr2 --oformat ihex
--- Additional Comments From jw at suse dot de 2007-01-15 22:20 --- Created an attachment (id=1501) --> (http://sourceware.org/bugzilla/attachment.cgi?id=1501&action=view) avr_test.o main object to test -- http://sourceware.org/bugzilla/show_bug.cgi?id=3874 --- 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