------- 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 mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to