While porting Linux to the Fujitsu RISC I observed that pointers within a structure were not initialized with the right addresses. After some investigation it boiled down to the linker.
Following testcase shows the problem. foo.s: .globl foo .data .p2align 2 .type foo, @object .size foo, 8 foo: .word 286331153 .word foo+4 .word foo+4 .word -1 .globl bar .data .p2align 2 .type bar, @object .size bar, 40 bar: .word 286331153 .word bar+4 .word bar+4 .word -1 assembled with: bash-2.05b$ fr30-elf-as foo.s -o foo.o and linked with: bash-2.05b$ fr30-elf-ld -t -stats foo.o fr30-elf-ld: mode elf32fr30 foo.o fr30-elf-ld: warning: cannot find entry symbol _start; defaulting to 00010000 What I would expect is: a2.out 00001000: 11111111 foo 00001004: 00010004 00001008: 00010004 0000100c: ffffffff 00001010: 11111111 bar 00001014: 00010014 < 00001018: 00010014 < 0000101c: ffffffff But what I get is: a.out 00001000: 11111111 foo 00001004: 00010004 00001008: 00010004 0000100c: ffffffff 00001010: 11111111 bar 00001014: 00010024 < 00001018: 00010024 < 0000101c: ffffffff -- Summary: Wrong data address after linking Product: binutils Version: 2.18 Status: NEW Severity: normal Priority: P2 Component: ld AssignedTo: unassigned at sources dot redhat dot com ReportedBy: markus dot heigl at fme dot fujitsu dot com CC: bug-binutils at gnu dot org GCC host triplet: i686-pc-linux-gnu GCC target triplet: fr30-unknown-elf http://sourceware.org/bugzilla/show_bug.cgi?id=5552 ------- 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