[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug binutils/5059] absolute objcopy not working on amd64?
From: |
kurt at roeckx dot be |
Subject: |
[Bug binutils/5059] absolute objcopy not working on amd64? |
Date: |
6 Oct 2007 12:39:48 -0000 |
------- Additional Comments From kurt at roeckx dot be 2007-10-06 12:39 -------
(In reply to comment #6)
> Please provide a testcase. Objcopy works for me:
>
> bash-3.2$ cat x.c
> void
> cmain (void)
> {
> *((int *) 0x1000) = 2;
> }
> bash-3.2$ make
> cc -O2 -c -o x.o x.c
> ./ld -o x x.o -N -Ttext 0x100
> ./ld: warning: cannot find entry symbol _start; defaulting to 0000000000000100
> ./objcopy x y
> cmp x y
> bash-3.2$
The test does:
$ cat x.c
void
cmain (void)
{
*((int *) 0x1000) = 2;
}
$ gcc -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000 x.c -o x2
/usr/bin/ld: warning: cannot find entry symbol _start; defaulting to
0000000000002000
$ gcc -nostdlib -Wl,-N -Wl,-Ttext -Wl,8000 x.c -o x2
/usr/bin/ld: warning: cannot find entry symbol _start; defaulting to
0000000000008000
$ objcopy -O binary x2 y2
$ objcopy -O binary x8 y8
$ cmp y2 y8
y2 y8 differ: byte 74, line 1
Note the -O binary that you didn't use.
Also note that adding -j .text to the objcopy call fixes the problem. Like Alan
Modra said, the difference is in the .eh_frame.
I have no idea if grub needs the .eh_frame or not, I'm guessing not.
Kurt
--
http://sourceware.org/bugzilla/show_bug.cgi?id=5059
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
- [Bug binutils/5059] absolute objcopy not working on amd64?, happyarch at gmail dot com, 2007/10/01
- [Bug binutils/5059] absolute objcopy not working on amd64?, hjl at lucon dot org, 2007/10/01
- [Bug binutils/5059] absolute objcopy not working on amd64?, happyarch at gmail dot com, 2007/10/02
- [Bug binutils/5059] absolute objcopy not working on amd64?, happyarch at gmail dot com, 2007/10/04
- [Bug binutils/5059] absolute objcopy not working on amd64?,
kurt at roeckx dot be <=
- [Bug binutils/5059] absolute objcopy not working on amd64?, kurt at roeckx dot be, 2007/10/06
- [Bug binutils/5059] absolute objcopy not working on amd64?, happyarch at gmail dot com, 2007/10/08