[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/5552] New: Wrong data address after linking
From: |
markus dot heigl at fme dot fujitsu dot com |
Subject: |
[Bug ld/5552] New: Wrong data address after linking |
Date: |
8 Jan 2008 13:16:04 -0000 |
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 ld/5552] New: Wrong data address after linking,
markus dot heigl at fme dot fujitsu dot com <=
- [Bug ld/5552] Wrong data address after linking, markus dot heigl at fme dot fujitsu dot com, 2008/01/08
- [Bug ld/5552] Wrong data address after linking, markus dot heigl at fme dot fujitsu dot com, 2008/01/08
- [Bug ld/5552] Wrong data address after linking, markus dot heigl at fme dot fujitsu dot com, 2008/01/08
- [Bug ld/5552] Wrong data address after linking, markus dot heigl at fme dot fujitsu dot com, 2008/01/08
- [Bug ld/5552] Wrong data address after linking, schwab at suse dot de, 2008/01/08
- [Bug ld/5552] Wrong data address after linking, markus dot heigl at fme dot fujitsu dot com, 2008/01/08
- [Bug gas/5552] Wrong data address after linking, amodra at bigpond dot net dot au, 2008/01/08
- [Bug gas/5552] Wrong data address after linking, nickc at redhat dot com, 2008/01/09
- [Bug gas/5552] Wrong data address after linking, nickc at redhat dot com, 2008/01/09