mips-arc build failure on xz_decompress.img
I tried to enable the mips-arc platform in Debian. When test-building, I first ran into a GCC uninitialised warning (promoted to an error by -Werror), which I fixed in
http://git.savannah.gnu.org/gitweb/?p=grub.git;a=commitdiff;h=1de3a48098053aaebd35232bd73e3ce3f3fdf51c.
Following that, I get:
if test x0 = x1; then ../grub-macho2img xz_decompress.image xz_decompress.img; else objcopy -O binary --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn -R .note.gnu.gold-version xz_decompress.image xz_decompress.img; fi
BFD: Warning: Writing section `.text' to huge (ie negative) file offset 0x87cfff48.
BFD: Warning: Writing section `.rodata' to huge (ie negative) file offset 0x87d027b8.
BFD: Warning: Writing section `.data.rel.ro' to huge (ie negative) file offset 0x87d02834.
BFD: Warning: Writing section `.data' to huge (ie negative) file offset 0x87d02898.
BFD: Warning: Writing section `.got' to huge (ie negative) file offset 0x87d028a8. objcopy:xz_decompress.img[.text]: File truncated
Makefile:41738: recipe for target 'xz_decompress.img' failed
make[5]: *** [xz_decompress.img] Error 1
Any idea what's going on here? Let me know if I need to provide more information.
Thanks,
Signature · 1 line
Colin Watson [[email protected]]
Quoted 16 lines · Colin Watson
I tried to enable the mips-arc platform in Debian. When test-building, I first ran into a GCC uninitialised warning (promoted to an error by -Werror), which I fixed in
http://git.savannah.gnu.org/gitweb/?p=grub.git;a=commitdiff;h=1de3a48098053aaebd35232bd73e3ce3f3fdf51c.
Following that, I get:if test x0 = x1; then ../grub-macho2img xz_decompress.image xz_decompress.img; else objcopy -O binary --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn -R .note.gnu.gold-version xz_decompress.image xz_decompress.img; fi
BFD: Warning: Writing section `.text' to huge (ie negative) file offset0x87cfff48.
BFD: Warning: Writing section `.rodata' to huge (ie negative) file offset0x87d027b8.
BFD: Warning: Writing section `.data.rel.ro' to huge (ie negative) file offset0x87d02834.
BFD: Warning: Writing section `.data' to huge (ie negative) file offset0x87d02898.
BFD: Warning: Writing section `.got' to huge (ie negative) file offset0x87d028a8. objcopy:xz_decompress.img[.text]: File truncated
Makefile:41738: recipe for target 'xz_decompress.img' failed
make[5]: *** [xz_decompress.img] Error 1
Quoted 3 lines
Any idea what's going on here? Let me know if I need to provide more information.
Looks similar to
http://www.linux-mips.org/archives/linux-mips/2006-06/msg00028.html.
Quoted 17 lines · Andrei Borzenkov
Quoted 16 lines · Colin Watson
I tried to enable the mips-arc platform in Debian. When test-building, I first ran into a GCC uninitialised warning (promoted to an error by -Werror), which I fixed in
http://git.savannah.gnu.org/gitweb/?p=grub.git;a=commitdiff;h=1de3a48098053aaebd35232bd73e3ce3f3fdf51c.
Following that, I get:if test x0 = x1; then ../grub-macho2img xz_decompress.image xz_decompress.img; else objcopy -O binary --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn -R .note.gnu.gold-version xz_decompress.image xz_decompress.img; fi
BFD: Warning: Writing section `.text' to huge (ie negative) file offset0x87cfff48.
BFD: Warning: Writing section `.rodata' to huge (ie negative) file offset0x87d027b8.
BFD: Warning: Writing section `.data.rel.ro' to huge (ie negative) file offset0x87d02834.
BFD: Warning: Writing section `.data' to huge (ie negative) file offset0x87d02898.
BFD: Warning: Writing section `.got' to huge (ie negative) file offset0x87d028a8. objcopy:xz_decompress.img[.text]: File truncated
Makefile:41738: recipe for target 'xz_decompress.img' failed
make[5]: *** [xz_decompress.img] Error 1
Quoted 7 lines
Quoted 3 lines
Any idea what's going on here? Let me know if I need to provide more information.
Looks similar to
http://www.linux-mips.org/archives/linux-mips/2006-06/msg00028.html.
To be more precise - Makefile is using -Wl,-Ttext,$(TARGET_DECOMPRESSOR_LINK_ADDR) with TARGET_DECOMPRESSOR_LINK_ADDR=0x88100000 for MIPS. It may need to explicitly specify start address for other sections as well, somewhere near 0x88100000.
Quoted 23 lines · Andrei Borzenkov
Quoted 22 lines · Andrei Borzenkov
Quoted 19 lines · Colin Watson
I tried to enable the mips-arc platform in Debian. When test-building, I first ran into a GCC uninitialised warning (promoted to an error by -Werror), which I fixed in
http://git.savannah.gnu.org/gitweb/?p=grub.git;a=commitdiff;h=1de3a48098053aaebd35232bd73e3ce3f3fdf51c.
Following that, I get:if test x0 = x1; then ../grub-macho2img xz_decompress.image xz_decompress.img; else objcopy -O binary --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn -R .note.gnu.gold-version xz_decompress.image xz_decompress.img; fi
BFD: Warning: Writing section `.text' to huge (ie negative) file offset0x87cfff48.
BFD: Warning: Writing section `.rodata' to huge (ie negative) file offset0x87d027b8.
BFD: Warning: Writing section `.data.rel.ro' to huge (ie negative) file offset0x87d02834.
BFD: Warning: Writing section `.data' to huge (ie negative) file offset0x87d02898.
BFD: Warning: Writing section `.got' to huge (ie negative) file offset0x87d028a8. objcopy:xz_decompress.img[.text]: File truncated
Makefile:41738: recipe for target 'xz_decompress.img' failed
make[5]: *** [xz_decompress.img] Error 1Any idea what's going on here? Let me know if I need to provide more information.
Quoted 9 lines
Quoted 2 lines
Looks similar to
http://www.linux-mips.org/archives/linux-mips/2006-06/msg00028.html.To be more precise -
Makefileis using -Wl,-Ttext,$(TARGET_DECOMPRESSOR_LINK_ADDR) with TARGET_DECOMPRESSOR_LINK_ADDR=0x88100000 for MIPS. It may need to explicitly specify start address for other sections as well, somewhere near0x88100000.
@Colin: do you have intermediate files? We should probably strip those extra sections.
Quoted 5 lines
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Quoted 2 lines · Vladimir 'φ-coder/phcoder' Serbinenko
@Colin: do you have intermediate files? We should probably strip those extra sections.
Right, I'm seeing the same thing on mipsel now, so it looks like a change introduced by new binutils. I've attached xz_decompress.image. "objdump -h" from a build on Debian wheezy looks like this:
obj/grub-yeeloong/grub-core/xz_decompress.image: file format elf32-tradlittlemips
Sections:
Idx Name Size VMA LMA File off Algn 0 .text 00002ab0 80100000 80100000 000000b0 2**4
CONTENTS, ALLOC, LOAD, CODE
1 .reginfo 00000018 00400094 00400094 00000094 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA, LINK_ONCE_SAME_SIZE
2 .rodata 000000dc 80102ab0 80102ab0 00002b60 2**4
CONTENTS, ALLOC, LOAD, READONLY, DATA
3 .data 00000010 80102b90 80102b90 00002c40 2**4
CONTENTS, ALLOC, LOAD, DATA
4 .sbss 00000004 80102ba0 80102ba0 00002c50 2**2
ALLOC
5 .bss 00007408 80102bb0 80102bb0 00002c50 2**4
ALLOC
6 .comment 0000001c 00000000 00000000 00002c50 2**0
CONTENTS, READONLY
7 .pdr 000002e0 00000000 00000000 00002c6c 2**2
CONTENTS, READONLY
8 .gnu.attributes 00000010 00000000 00000000 00002f4c 2**0
CONTENTS, READONLY
9 .mdebug.abi32 00000000 00000000 00000000 00002f5c 2**0
CONTENTS, READONLY
And "objdump -h" from a build on Debian jessie looks like this:
obj/grub-yeeloong/grub-core/xz_decompress.image: file format elf32-tradlittlemips
Sections:
Idx Name Size VMA LMA File off Algn 0 .text 00002af0 80100000 80100000 000000f0 2**4
CONTENTS, ALLOC, LOAD, CODE
1 .MIPS.abiflags 00000018 004000b8 004000b8 000000b8 2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA, LINK_ONCE_SAME_SIZE
2 .reginfo 00000018 004000d0 004000d0 000000d0 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA, LINK_ONCE_SAME_SIZE
3 .rodata 0000007c 80102af0 80102af0 00002be0 2**4
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 .data.rel.ro 00000058 80102b6c 80102b6c 00002c5c 2**2
CONTENTS, ALLOC, LOAD, DATA
5 .data 00000010 80102bd0 80102bd0 00002cc0 2**4
CONTENTS, ALLOC, LOAD, DATA
6 .got 00000044 80102be0 80102be0 00002cd0 2**4
CONTENTS, ALLOC, LOAD, DATA
7 .sbss 00000004 80102c24 80102c24 00002d14 2**2
ALLOC
8 .bss 00007408 80102c30 80102c30 00002d14 2**4
ALLOC
9 .comment 0000001d 00000000 00000000 00002d14 2**0
CONTENTS, READONLY
10 .pdr 000002e0 00000000 00000000 00002d34 2**2
CONTENTS, READONLY
11 .gnu.attributes 00000010 00000000 00000000 00003014 2**0
CONTENTS, READONLY
12 .mdebug.abi32 00000000 00000000 00000000 00003024 2**0
CONTENTS, READONLY
"-R .MIPS.abiflags" seems to fix things; does that need to be added anywhere other than gentpl.py:image?
Signature · 1 line
Colin Watson [[email protected]]