* BFD: Warning: Writing section `.text' to huge (ie negative) file offset 0xa1ffff10
@ 2006-06-01 6:19 zhuzhenhua
2006-06-01 9:24 ` Thiemo Seufer
0 siblings, 1 reply; 10+ messages in thread
From: zhuzhenhua @ 2006-06-01 6:19 UTC (permalink / raw)
To: linux-mips
i have write a code to link at 0xa2000000(uncached address)
but when link i get the error as
"BFD: Warning: Writing section `.text' to huge (ie negative) file
offset 0xa1ffff10.
BFD: Warning: Writing section `.data' to huge (ie negative) file
offset 0xa200b050.
BFD: Warning: Writing section `.reginfo' to huge (ie negative) file
offset 0xa200c980.
mipsel-linux-objcopy: /root/project/brec_flash/release/brec_flash.bin:
File truncated
make: *** [brec_flash] Error 1"
my link.xn as follow:
OUTPUT_ARCH(mips)
ENTRY(brec_flash_entry)
SECTIONS
{
.text 0xa2000000 :
{
release/entry.o (.text)
release/*(.text)
}
.data :
{
release/*(.data)
}
.sbss :
{
release/*(.sbss)
release/*(.scommon)
}
.bss :
{
release/*(.bss)
release/*(COMMON)
}
}
thanks for any hints
Best Regards
zhuzhenhua
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: BFD: Warning: Writing section `.text' to huge (ie negative) file offset 0xa1ffff10 2006-06-01 6:19 BFD: Warning: Writing section `.text' to huge (ie negative) file offset 0xa1ffff10 zhuzhenhua @ 2006-06-01 9:24 ` Thiemo Seufer 2006-06-01 10:56 ` zhuzhenhua 0 siblings, 1 reply; 10+ messages in thread From: Thiemo Seufer @ 2006-06-01 9:24 UTC (permalink / raw) To: zhuzhenhua; +Cc: linux-mips zhuzhenhua wrote: > i have write a code to link at 0xa2000000(uncached address) > but when link i get the error as > "BFD: Warning: Writing section `.text' to huge (ie negative) file > offset 0xa1ffff10. > BFD: Warning: Writing section `.data' to huge (ie negative) file > offset 0xa200b050. > BFD: Warning: Writing section `.reginfo' to huge (ie negative) file > offset 0xa200c980. > mipsel-linux-objcopy: /root/project/brec_flash/release/brec_flash.bin: > File truncated > make: *** [brec_flash] Error 1" > > my link.xn as follow: > > OUTPUT_ARCH(mips) > ENTRY(brec_flash_entry) > SECTIONS > { > .text 0xa2000000 : Use . = 0xa2000000; .text : instead. "info ld" explains the subtle difference. Thiemo ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: BFD: Warning: Writing section `.text' to huge (ie negative) file offset 0xa1ffff10 2006-06-01 9:24 ` Thiemo Seufer @ 2006-06-01 10:56 ` zhuzhenhua 2006-06-01 12:49 ` Nigel Stephens 0 siblings, 1 reply; 10+ messages in thread From: zhuzhenhua @ 2006-06-01 10:56 UTC (permalink / raw) To: Thiemo Seufer; +Cc: linux-mips On 6/1/06, Thiemo Seufer <ths@networkno.de> wrote: > zhuzhenhua wrote: > > i have write a code to link at 0xa2000000(uncached address) > > but when link i get the error as > > "BFD: Warning: Writing section `.text' to huge (ie negative) file > > offset 0xa1ffff10. > > BFD: Warning: Writing section `.data' to huge (ie negative) file > > offset 0xa200b050. > > BFD: Warning: Writing section `.reginfo' to huge (ie negative) file > > offset 0xa200c980. > > mipsel-linux-objcopy: /root/project/brec_flash/release/brec_flash.bin: > > File truncated > > make: *** [brec_flash] Error 1" > > > > my link.xn as follow: > > > > OUTPUT_ARCH(mips) > > ENTRY(brec_flash_entry) > > SECTIONS > > { > > .text 0xa2000000 : > > Use > > . = 0xa2000000; > .text : > > instead. "info ld" explains the subtle difference. > > > Thiemo > do you mean use . = 0xa2000000; .text : to replace .text 0xa2000000 : ? i modify as that, and it still get the same message thanks zhuzhenhua ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: BFD: Warning: Writing section `.text' to huge (ie negative) file offset 0xa1ffff10 2006-06-01 10:56 ` zhuzhenhua @ 2006-06-01 12:49 ` Nigel Stephens 2006-06-02 0:49 ` zhuzhenhua 0 siblings, 1 reply; 10+ messages in thread From: Nigel Stephens @ 2006-06-01 12:49 UTC (permalink / raw) To: zhuzhenhua; +Cc: Thiemo Seufer, linux-mips zhuzhenhua wrote: > On 6/1/06, Thiemo Seufer <ths@networkno.de> wrote: >> zhuzhenhua wrote: >> > i have write a code to link at 0xa2000000(uncached address) >> > but when link i get the error as >> > "BFD: Warning: Writing section `.text' to huge (ie negative) file >> > offset 0xa1ffff10. >> > BFD: Warning: Writing section `.data' to huge (ie negative) file >> > offset 0xa200b050. >> > BFD: Warning: Writing section `.reginfo' to huge (ie negative) file >> > offset 0xa200c980. >> > mipsel-linux-objcopy: /root/project/brec_flash/release/brec_flash.bin: >> > File truncated >> > make: *** [brec_flash] Error 1" >> > >> > my link.xn as follow: >> > >> > OUTPUT_ARCH(mips) >> > ENTRY(brec_flash_entry) >> > SECTIONS >> > { >> > .text 0xa2000000 : >> >> Use >> >> . = 0xa2000000; >> .text : >> >> instead. "info ld" explains the subtle difference. >> >> >> Thiemo >> > > do you mean use > . = 0xa2000000; > .text : > to replace > .text 0xa2000000 : > ? > i modify as that, and it still get the same message > I think the problem is not with the linker, but in your use of objcopy to convert your ELF file to a raw binary file. 1) What arguments are you giving to mipsel-linux-objcopy? 2) What is the output from mipsel-linux-objdump -h run on your intermediate ELF object file? Nigel -- Nigel Stephens e. nigel@mips.com MIPS Technologies p. +44 1223 203110 Building 7200 f. +44 1223 203181 Cambridge Research Park m. +44 7976 686470 Beach Road, Waterbeach w. http://www.mips.com Cambridge CB5 9TL, UK ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: BFD: Warning: Writing section `.text' to huge (ie negative) file offset 0xa1ffff10 2006-06-01 12:49 ` Nigel Stephens @ 2006-06-02 0:49 ` zhuzhenhua 2006-06-02 2:50 ` zhuzhenhua 2006-06-02 11:00 ` Nigel Stephens 0 siblings, 2 replies; 10+ messages in thread From: zhuzhenhua @ 2006-06-02 0:49 UTC (permalink / raw) To: Nigel Stephens; +Cc: Thiemo Seufer, linux-mips On 6/1/06, Nigel Stephens <nigel@mips.com> wrote: > > > zhuzhenhua wrote: > > On 6/1/06, Thiemo Seufer <ths@networkno.de> wrote: > >> zhuzhenhua wrote: > >> > i have write a code to link at 0xa2000000(uncached address) > >> > but when link i get the error as > >> > "BFD: Warning: Writing section `.text' to huge (ie negative) file > >> > offset 0xa1ffff10. > >> > BFD: Warning: Writing section `.data' to huge (ie negative) file > >> > offset 0xa200b050. > >> > BFD: Warning: Writing section `.reginfo' to huge (ie negative) file > >> > offset 0xa200c980. > >> > mipsel-linux-objcopy: /root/project/brec_flash/release/brec_flash.bin: > >> > File truncated > >> > make: *** [brec_flash] Error 1" > >> > > >> > my link.xn as follow: > >> > > >> > OUTPUT_ARCH(mips) > >> > ENTRY(brec_flash_entry) > >> > SECTIONS > >> > { > >> > .text 0xa2000000 : > >> > >> Use > >> > >> . = 0xa2000000; > >> .text : > >> > >> instead. "info ld" explains the subtle difference. > >> > >> > >> Thiemo > >> > > > > do you mean use > > . = 0xa2000000; > > .text : > > to replace > > .text 0xa2000000 : > > ? > > i modify as that, and it still get the same message > > > > I think the problem is not with the linker, but in your use of objcopy > to convert your ELF file to a raw binary file. > > 1) What arguments are you giving to mipsel-linux-objcopy? i use objcopy as follow(the brec_flash is elf file) mipsel-linux-objcopy -O binary brec_flash brec_flash.bin > > 2) What is the output from mipsel-linux-objdump -h run on your > intermediate ELF object file? i use mipsel-linux-objdump -h brec_flash and get messages as follow brec_flash: file format elf32-tradlittlemips Sections: Idx Name Size VMA LMA File off Algn 0 .text 0000b140 72000000 72000000 00010000 2**4 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .data 00001080 7200b140 7200b140 0001b140 2**4 CONTENTS, ALLOC, LOAD, DATA 2 .sbss 00000010 7200c1c0 7200c1c0 0001c1c0 2**2 ALLOC 3 .bss 000008a0 7200c1d0 7200c1d0 0001c1c0 2**4 ALLOC 4 .reginfo 00000018 7200ca70 7200ca70 0001ca70 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA, LINK_ONCE_SAME_SIZE 5 .pdr 000011a0 00000000 00000000 0001ca88 2**2 CONTENTS, READONLY 6 .mdebug.abi32 00000000 00000000 00000000 0001dc28 2**0 CONTENTS, READONLY 7 .comment 000000ea 00000000 00000000 0001dc28 2**0 CONTENTS, READONLY 8 .rodata 00000190 000000f0 000000f0 000000f0 2**4 CONTENTS, ALLOC, LOAD, READONLY, DATA 9 .rodata.str1.4 000005fe 00000280 00000280 00000280 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA > > > Nigel > > -- > Nigel Stephens e. nigel@mips.com > MIPS Technologies p. +44 1223 203110 > Building 7200 f. +44 1223 203181 > Cambridge Research Park m. +44 7976 686470 > Beach Road, Waterbeach w. http://www.mips.com > Cambridge CB5 9TL, UK > > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: BFD: Warning: Writing section `.text' to huge (ie negative) file offset 0xa1ffff10 2006-06-02 0:49 ` zhuzhenhua @ 2006-06-02 2:50 ` zhuzhenhua 2006-06-02 9:48 ` Thiemo Seufer 2006-06-02 11:00 ` Nigel Stephens 1 sibling, 1 reply; 10+ messages in thread From: zhuzhenhua @ 2006-06-02 2:50 UTC (permalink / raw) To: Nigel Stephens; +Cc: Thiemo Seufer, linux-mips On 6/2/06, zhuzhenhua <zzh.hust@gmail.com> wrote: > On 6/1/06, Nigel Stephens <nigel@mips.com> wrote: > > > > > > zhuzhenhua wrote: > > > On 6/1/06, Thiemo Seufer <ths@networkno.de> wrote: > > >> zhuzhenhua wrote: > > >> > i have write a code to link at 0xa2000000(uncached address) > > >> > but when link i get the error as > > >> > "BFD: Warning: Writing section `.text' to huge (ie negative) file > > >> > offset 0xa1ffff10. > > >> > BFD: Warning: Writing section `.data' to huge (ie negative) file > > >> > offset 0xa200b050. > > >> > BFD: Warning: Writing section `.reginfo' to huge (ie negative) file > > >> > offset 0xa200c980. > > >> > mipsel-linux-objcopy: /root/project/brec_flash/release/brec_flash.bin: > > >> > File truncated > > >> > make: *** [brec_flash] Error 1" > > >> > > > >> > my link.xn as follow: > > >> > > > >> > OUTPUT_ARCH(mips) > > >> > ENTRY(brec_flash_entry) > > >> > SECTIONS > > >> > { > > >> > .text 0xa2000000 : > > >> > > >> Use > > >> > > >> . = 0xa2000000; > > >> .text : > > >> > > >> instead. "info ld" explains the subtle difference. > > >> > > >> > > >> Thiemo > > >> > > > > > > do you mean use > > > . = 0xa2000000; > > > .text : > > > to replace > > > .text 0xa2000000 : > > > ? > > > i modify as that, and it still get the same message > > > > > > > I think the problem is not with the linker, but in your use of objcopy > > to convert your ELF file to a raw binary file. > > > > 1) What arguments are you giving to mipsel-linux-objcopy? > i use objcopy as follow(the brec_flash is elf file) > mipsel-linux-objcopy -O binary brec_flash brec_flash.bin > > > > 2) What is the output from mipsel-linux-objdump -h run on your > > intermediate ELF object file? > i use mipsel-linux-objdump -h brec_flash and get messages as follow > > > brec_flash: file format elf32-tradlittlemips > > Sections: > Idx Name Size VMA LMA File off Algn > 0 .text 0000b140 72000000 72000000 00010000 2**4 > CONTENTS, ALLOC, LOAD, READONLY, CODE > 1 .data 00001080 7200b140 7200b140 0001b140 2**4 > CONTENTS, ALLOC, LOAD, DATA > 2 .sbss 00000010 7200c1c0 7200c1c0 0001c1c0 2**2 > ALLOC > 3 .bss 000008a0 7200c1d0 7200c1d0 0001c1c0 2**4 > ALLOC > 4 .reginfo 00000018 7200ca70 7200ca70 0001ca70 2**2 > CONTENTS, ALLOC, LOAD, READONLY, DATA, LINK_ONCE_SAME_SIZE > 5 .pdr 000011a0 00000000 00000000 0001ca88 2**2 > CONTENTS, READONLY > 6 .mdebug.abi32 00000000 00000000 00000000 0001dc28 2**0 > CONTENTS, READONLY > 7 .comment 000000ea 00000000 00000000 0001dc28 2**0 > CONTENTS, READONLY > 8 .rodata 00000190 000000f0 000000f0 000000f0 2**4 > CONTENTS, ALLOC, LOAD, READONLY, DATA > 9 .rodata.str1.4 000005fe 00000280 00000280 00000280 2**2 > CONTENTS, ALLOC, LOAD, READONLY, DATA the 0x72xxxxxx should be 0xa2xxxxxx, because i can't pass by set 0xa2000000,so i change the .text to 0x72000000, and it can get the .bin correctly. > > > > > > > Nigel > > > > -- > > Nigel Stephens e. nigel@mips.com > > MIPS Technologies p. +44 1223 203110 > > Building 7200 f. +44 1223 203181 > > Cambridge Research Park m. +44 7976 686470 > > Beach Road, Waterbeach w. http://www.mips.com > > Cambridge CB5 9TL, UK > > > > > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: BFD: Warning: Writing section `.text' to huge (ie negative) file offset 0xa1ffff10 2006-06-02 2:50 ` zhuzhenhua @ 2006-06-02 9:48 ` Thiemo Seufer 0 siblings, 0 replies; 10+ messages in thread From: Thiemo Seufer @ 2006-06-02 9:48 UTC (permalink / raw) To: zhuzhenhua; +Cc: Nigel Stephens, linux-mips zhuzhenhua wrote: [snip] > >Idx Name Size VMA LMA File off Algn > > 0 .text 0000b140 72000000 72000000 00010000 2**4 > > CONTENTS, ALLOC, LOAD, READONLY, CODE > > 1 .data 00001080 7200b140 7200b140 0001b140 2**4 > > CONTENTS, ALLOC, LOAD, DATA > > 2 .sbss 00000010 7200c1c0 7200c1c0 0001c1c0 2**2 > > ALLOC > > 3 .bss 000008a0 7200c1d0 7200c1d0 0001c1c0 2**4 > > ALLOC > > 4 .reginfo 00000018 7200ca70 7200ca70 0001ca70 2**2 > > CONTENTS, ALLOC, LOAD, READONLY, DATA, > > LINK_ONCE_SAME_SIZE > > 5 .pdr 000011a0 00000000 00000000 0001ca88 2**2 > > CONTENTS, READONLY > > 6 .mdebug.abi32 00000000 00000000 00000000 0001dc28 2**0 > > CONTENTS, READONLY > > 7 .comment 000000ea 00000000 00000000 0001dc28 2**0 > > CONTENTS, READONLY > > 8 .rodata 00000190 000000f0 000000f0 000000f0 2**4 > > CONTENTS, ALLOC, LOAD, READONLY, DATA > > 9 .rodata.str1.4 000005fe 00000280 00000280 00000280 2**2 > > CONTENTS, ALLOC, LOAD, READONLY, DATA > > the 0x72xxxxxx should be 0xa2xxxxxx, because i can't pass by set > 0xa2000000,so i change the .text to 0x72000000, and it can get the > .bin correctly. At some version the check for sign extensions was broken for MIPS binutils, in that case the workaround was to specify the full sign extension for 64 bit, that is 0xffffffffa0000000. Thiemo ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: BFD: Warning: Writing section `.text' to huge (ie negative) file offset 0xa1ffff10 2006-06-02 0:49 ` zhuzhenhua 2006-06-02 2:50 ` zhuzhenhua @ 2006-06-02 11:00 ` Nigel Stephens 2006-06-02 11:11 ` Nigel Stephens 1 sibling, 1 reply; 10+ messages in thread From: Nigel Stephens @ 2006-06-02 11:00 UTC (permalink / raw) To: zhuzhenhua; +Cc: Thiemo Seufer, linux-mips zhuzhenhua wrote: > >> >> I think the problem is not with the linker, but in your use of objcopy >> to convert your ELF file to a raw binary file. >> >> 1) What arguments are you giving to mipsel-linux-objcopy? > i use objcopy as follow(the brec_flash is elf file) > mipsel-linux-objcopy -O binary brec_flash brec_flash.bin >> >> 2) What is the output from mipsel-linux-objdump -h run on your >> intermediate ELF object file? > i use mipsel-linux-objdump -h brec_flash and get messages as follow > > > brec_flash: file format elf32-tradlittlemips > > Sections: > Idx Name Size VMA LMA File off Algn > 0 .text 0000b140 72000000 72000000 00010000 2**4 > CONTENTS, ALLOC, LOAD, READONLY, CODE > 1 .data 00001080 7200b140 7200b140 0001b140 2**4 > CONTENTS, ALLOC, LOAD, DATA > 2 .sbss 00000010 7200c1c0 7200c1c0 0001c1c0 2**2 > ALLOC > 3 .bss 000008a0 7200c1d0 7200c1d0 0001c1c0 2**4 > ALLOC > 4 .reginfo 00000018 7200ca70 7200ca70 0001ca70 2**2 > CONTENTS, ALLOC, LOAD, READONLY, DATA, > LINK_ONCE_SAME_SIZE > 5 .pdr 000011a0 00000000 00000000 0001ca88 2**2 > CONTENTS, READONLY > 6 .mdebug.abi32 00000000 00000000 00000000 0001dc28 2**0 > CONTENTS, READONLY > 7 .comment 000000ea 00000000 00000000 0001dc28 2**0 > CONTENTS, READONLY > 8 .rodata 00000190 000000f0 000000f0 000000f0 2**4 > CONTENTS, ALLOC, LOAD, READONLY, DATA > 9 .rodata.str1.4 000005fe 00000280 00000280 00000280 2**2 > CONTENTS, ALLOC, LOAD, READONLY, DATA OK. I think that the final .rodata.str1.4 section is causing your problem because the offset between its load address and the other section is huge, causing "objcopy -O binary" to generate a huge file. This is a new section generated by gcc 3.x and above to hold mergeable constant data. Try changing the line in your linker script which (I'm guessing here) probably looks like this: *(.rodata) to: *(.rodata) *(.rodata.*) Nigel ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: BFD: Warning: Writing section `.text' to huge (ie negative) file offset 0xa1ffff10 2006-06-02 11:00 ` Nigel Stephens @ 2006-06-02 11:11 ` Nigel Stephens 2006-06-03 4:36 ` zhuzhenhua 0 siblings, 1 reply; 10+ messages in thread From: Nigel Stephens @ 2006-06-02 11:11 UTC (permalink / raw) To: zhuzhenhua; +Cc: Thiemo Seufer, linux-mips Nigel Stephens wrote: > >> >> 8 .rodata 00000190 000000f0 000000f0 000000f0 2**4 >> CONTENTS, ALLOC, LOAD, READONLY, DATA >> 9 .rodata.str1.4 000005fe 00000280 00000280 00000280 2**2 >> CONTENTS, ALLOC, LOAD, READONLY, DATA > > OK. I think that the final .rodata.str1.4 section is causing your > problem because the offset between its load address and the other > section is huge, causing "objcopy -O binary" to generate a huge file. > This is a new section generated by gcc 3.x and above to hold mergeable > constant data. Try changing the line in your linker script which (I'm > guessing here) probably looks like this: > > *(.rodata) > > to: > > *(.rodata) *(.rodata.*) > I failed to spot that .rodata also has a "bad" load address. So it looks like .rodata also isn't correctly handled in your linker script. Nigel ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: BFD: Warning: Writing section `.text' to huge (ie negative) file offset 0xa1ffff10 2006-06-02 11:11 ` Nigel Stephens @ 2006-06-03 4:36 ` zhuzhenhua 0 siblings, 0 replies; 10+ messages in thread From: zhuzhenhua @ 2006-06-03 4:36 UTC (permalink / raw) To: Nigel Stephens; +Cc: Thiemo Seufer, linux-mips On 6/2/06, Nigel Stephens <nigel@mips.com> wrote: > > > Nigel Stephens wrote: > > > >> > >> 8 .rodata 00000190 000000f0 000000f0 000000f0 2**4 > >> CONTENTS, ALLOC, LOAD, READONLY, DATA > >> 9 .rodata.str1.4 000005fe 00000280 00000280 00000280 2**2 > >> CONTENTS, ALLOC, LOAD, READONLY, DATA > > > > OK. I think that the final .rodata.str1.4 section is causing your > > problem because the offset between its load address and the other > > section is huge, causing "objcopy -O binary" to generate a huge file. > > This is a new section generated by gcc 3.x and above to hold mergeable > > constant data. Try changing the line in your linker script which (I'm > > guessing here) probably looks like this: > > > > *(.rodata) > > > > to: > > > > *(.rodata) *(.rodata.*) > > > > I failed to spot that .rodata also has a "bad" load address. So it looks > like .rodata also isn't correctly handled in your linker script. you are right, i do not handle it correctly, and now i fixed it and the objcopy run with out warning. > > Nigel > > > thanks for all above Best Regards zhuzhenhua ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2006-06-03 4:36 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-06-01 6:19 BFD: Warning: Writing section `.text' to huge (ie negative) file offset 0xa1ffff10 zhuzhenhua 2006-06-01 9:24 ` Thiemo Seufer 2006-06-01 10:56 ` zhuzhenhua 2006-06-01 12:49 ` Nigel Stephens 2006-06-02 0:49 ` zhuzhenhua 2006-06-02 2:50 ` zhuzhenhua 2006-06-02 9:48 ` Thiemo Seufer 2006-06-02 11:00 ` Nigel Stephens 2006-06-02 11:11 ` Nigel Stephens 2006-06-03 4:36 ` zhuzhenhua
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.