u-boot.lds i686-pc-linux-gnu-ld section .start16 overlaps section .text
Hi I add a ethernet driver to u-boot, when I compile the source tree, I got the following link error, can anyone please suggest me how to fix the error?
i686-pc-linux-gnu-ld:
section .start16 [05ffff00 -> 05ffffba] overlaps section .text [05fe0000 ->06011b85]
i686-pc-linux-gnu-ld:
section .reset [05fffff0 -> 05ffffff] overlaps section .text [05fe0000 ->06011b85]
make: *** [u-boot] Error 1
I searched in Google, and someone suggest that I can modify u-boot.lds to fix the error, but I do not know how to do that. appreciate it if anyone can give me a hint or a solution.
Thanks
Signature · 2 lines
View this message in context: http://www.nabble.com/u-boot.lds---i686-pc-linux-gnu-ld-section-.start16-overlaps-section-.text-tp20828386p20828386.html Sent from the Uboot - Users mailing list archive at Nabble.com.
[U-Boot] u-boot.lds i686-pc-linux-gnu-ld section .start16 overlapssection .text
Hi,
It seems ur linker script is overlapping both the sections .start16 and text and similarly the reset and text.
Try to change the boundary limits for the sections to prevent conflicts, this is due to the new addition of the driver code.
Thanks & Regards,
Vignesh Kumar B
-----Original Message-----
From: [email protected] [mailto:u-boot-bounces at lists.denx.de] On Behalf Of LanceZ
Sent: Thursday, December 04, 2008 12:38 PM
To: u-boot at lists.denx.de
Subject: [U-Boot] u-boot.lds i686-pc-linux-gnu-ld section .start16 overlapssection .text
Hi I add a ethernet driver to u-boot, when I compile the source tree, I got
the following link error, can anyone please suggest me how to fix the error?
i686-pc-linux-gnu-ld:
section .start16 [05ffff00 -> 05ffffba] overlaps section .text
[05fe0000 ->06011b85]
i686-pc-linux-gnu-ld:
section .reset [05fffff0 -> 05ffffff] overlaps section .text [05fe0000
->06011b85]
make: *** [u-boot] Error 1
I searched in Google, and someone suggest that I can modify u-boot.lds to
fix the error, but I do not know how to do that. appreciate it if anyone
can give me a hint or a solution.
Thanks
Signature · 26 lines
View this message in context: http://www.nabble.com/u-boot.lds---i686-pc-linux-gnu-ld-section-.start16 -overlaps-section-.text-tp20828386p20828386.html Sent from the Uboot - Users mailing list archive at Nabble.com. _______________________________________________ U-Boot mailing list U-Boot at lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot Thanks & Regards, Vignesh Kumar B Disclaimer: This message and any attachment(s) contained here are information that is confidential, proprietary to HCL Technologies and its customers. Contents may be privileged or otherwise protected by law. The information is solely intended for the individual or the entity it is addressed to. If you are not the intended recipient of this message, you are not authorized to read, forward, print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, please notify the sender immediately by return e-mail and delete it from your computer.
-----Original Message-----
From: [email protected] [mailto:u-boot-bounces at lists.denx.de] On Behalf Of LanceZ
Sent: Thursday, December 04, 2008 12:38 PM
To: u-boot at lists.denx.de
Subject: [U-Boot] u-boot.lds i686-pc-linux-gnu-ld section .start16 overlapssection .text
Hi I add a ethernet driver to u-boot, when I compile the source tree, I got
the following link error, can anyone please suggest me how to fix the error?
i686-pc-linux-gnu-ld:
section .start16 [05ffff00 -> 05ffffba] overlaps section .text
[05fe0000 ->06011b85]
i686-pc-linux-gnu-ld:
section .reset [05fffff0 -> 05ffffff] overlaps section .text [05fe0000
->06011b85]
make: *** [u-boot] Error 1
I searched in Google, and someone suggest that I can modify u-boot.lds to
fix the error, but I do not know how to do that. appreciate it if anyone
can give me a hint or a solution.
Thanks
Signature · 22 lines
View this message in context: http://www.nabble.com/u-boot.lds---i686-pc-linux-gnu-ld-section-.start16 -overlaps-section-.text-tp20828386p20828386.html Sent from the Uboot - Users mailing list archive at Nabble.com. _______________________________________________ U-Boot mailing list U-Boot at lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. -----------------------------------------------------------------------------------------------------------------------
[U-Boot] u-boot.lds i686-pc-linux-gnu-ld section .start16 overlapssection .text
Vignesh, Thank you very much.
Quoted 1 line
Try to change the boundary limits for the sections to prevent
conflicts,
Quoted 1 line
this is due to the new addition of the driver code.
I am not familiar with the liker script.
Can I simplely modify the following codes in u-boot.lds
. = 0xff00;
.start16 : AT (0x05ffff00) { *(.start16); }
. = 0xfff0;
.reset : AT (0x05fffff0) { *(.reset); }
To
. = 0xff00;
.start16 : AT (0x06ffff00) { *(.start16); }
. = 0xfff0;
.reset : AT (0x06fffff0) { *(.reset); }
The compilation is Ok, but the file size is 26M, it is very large.
Can you told me how to change the lds file. Thanks very much
The errors outputted by ld
i686-pc-linux-gnu-ld:
section .start16 [05ffff00 -> 05ffffba] overlaps section .text
[05fe0000 -> 06011b85]
i686-pc-linux-gnu-ld:
section .reset [05fffff0 -> 05ffffff] overlaps section .text [05fe0000
-> 06011b85]
make: *** [u-boot] Error 1
The lds contents:OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
OUTPUT_ARCH(i386)
ENTRY(_start)
SECTIONS
{
/* here is where we are in flash: last 128k */ . = 0x05fe0000;
.text : { *(.text); }
. = ALIGN(4);
.rodata : { *(.rodata) *(.rodata.str1.1) *(.rodata.str1.32) }
/* define its reloation address as off in RAM at 1M below 64M
line, but use
* AT () to make its load address right here, after previous */
. = 0x2000;
_i386boot_romdata_dest = ABSOLUTE(.);
.data : AT ( LOADADDR(.rodata) + SIZEOF(.rodata) ) { *(.data) } _i386boot_romdata_start = LOADADDR(.data);
__u_boot_cmd_start = .;
.u_boot_cmd : AT ( LOADADDR (.data ) + SIZEOF (.data) ) {
*(.u_boot_cmd) }
__u_boot_cmd_end = .;
.got : AT ( LOADADDR(.u_boot_cmd) + SIZEOF(.u_boot_cmd) ) {
*(.got) }
_i386boot_romdata_size = SIZEOF(.data) + SIZEOF(.got) + SIZEOF
(.u_boot_cmd);
. = 0x8000;
_i386boot_bss_start = ABSOLUTE(.);
.bss : { *(.bss) }
_i386boot_bss_size = SIZEOF(.bss);
/* 16bit realmode trampoline code */
.realmode 0x7c0 : AT ( LOADADDR(.got) + SIZEOF(.got) ) {
*(.realmode) }
_i386boot_realmode = LOADADDR(.realmode); _i386boot_realmode_size = SIZEOF(.realmode);
/* 16bit BIOS emulation code (just enough to boot Linux) */ .bios 0 : AT ( LOADADDR(.realmode) + SIZEOF(.realmode) ) {
*(.bios) }
_i386boot_bios = LOADADDR(.bios);
_i386boot_bios_size = SIZEOF(.bios);
/* The load addresses below assumes that the flash
* will be mapped so that 0x3fe0000 == 0xffff0000
* at reset time
*
* The fe00 and ff00 offsets of the start32 and start16
* segments are arbitrary, the just have to be mapped
* at reset and the code have to fit.
* The fff0 offset of reset is important, however. */
. = 0xfffffe00;
.start32 : AT (0x05fffe00) { *(.start32); }
. = 0xff00;
.start16 : AT (0x05ffff00) { *(.start16); }
. = 0xfff0;
.reset : AT (0x05fffff0) { *(.reset); } _i386boot_end = (LOADADDR(.reset) + SIZEOF(.reset) );
}
[U-Boot] u-boot.lds i686-pc-linux-gnu-ld section .start16 overlapssection .text
Hi Lance,
I've been working on the i386 build for a while now and have some knowledge
of the linker script for this particular port so hopefully I can give some
meaningful advice....
Quoted 5 lines · Lance Zhang
Vignesh, Thank you very much.
Quoted 1 line
Try to change the boundary limits for the sections to prevent
conflicts,
Quoted 1 line
this is due to the new addition of the driver code.
There should have been a fair amount of space left in the binary. For example, my current build has a gap from 0x14cca to 0x3f7ff (~170kB) in a 256kB binary so there should be plenty of room to add an Ethernet driver
Quoted 10 lines
I am not familiar with the liker script.
Can I simplely modify the following codes inu-boot.lds. = 0xff00;(quoted diff) +0
-0.start16 : AT (0x05ffff00) { *(.start16); } . = 0xfff0; .reset : AT (0x05fffff0) { *(.reset); }To
. = 0xff00;
Review
Quoted 4 lines
(quoted diff) +0
-0.start16 : AT (0x06ffff00) { *(.start16); } . = 0xfff0; .reset : AT (0x06fffff0) { *(.reset); }
Probably not. The locations of .start16 and .reset must be very carefully set. .reset must occupy the last 16 bytes of your binary image. The i386 starts executing code 16 bytes before the very end if its (real mode) address space. Other CPUs start at 0x0000000 which makes life a lot easier
.start16 is the code that switches the CPU into protected mode. Until then, branch distances are (fairly) short, so .start16 needs to be close to .reset
Quoted 9 lines
The compilation is Ok, but the file size is 26M, it is very large.
Can you told me how to change the lds file. Thanks very much
The errors outputted by ld
i686-pc-linux-gnu-ld:
section .start16 [05ffff00->05ffffba] overlaps section .text
[05fe0000->06011b85]
If you look at the layout of the various sections in the binary now, .text occupies 0x05fe0000 -> 0x06011b85 and .reset occupies 0x06fffff0 -> 0x06ffffff
0x06ffffff (end of .reset) - 0x05fe0000 (start of .text) = 0x101ffff (~16MB) and most of this is just empty space (0x06011b86 -> 0x06fffeff - end of .text to start of .start16) - The extra 10M is a bit of a mystery - maybe more space between sections
Have a look at u-boot.map - This file is generated by the linker and it will tell you exactly where it put everything
Also, .text section (the one that holds all the code) looks to be very big:
0x06011b85 - 0x05fe0000 = 0x31b85 (~200kB)
You bootloader image will be bigger than this still after all the .data sections are added (printf strings etc)
Quoted 5 lines
i686-pc-linux-gnu-ld:
section .reset [05fffff0->05ffffff] overlaps section .text [05fe0000
->06011b85]
make: *** [u-boot] Error 1
Quoted 8 lines
The lds contents:
OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
OUTPUT_ARCH(i386)
ENTRY(_start)SECTIONS
{
/* here is where we are in flash: last 128k */
This looks like a problem - Your flash is only 128k, but you code is at least 200k
<snip> - Remainder of script looks OK
I would stick to the original linker script and try to figure out why .text
grew so much. Have a look at u-boot.map and try to figure out what is
using all the space
Regards,
Graeme
[U-Boot] u-boot.lds i686-pc-linux-gnu-ld section .start16 overlapssection .text
Quoted 1 line
Have a look at u-boot.map - This file is generated by the linker and it
will >tell you exactly where it put everything
Quoted 1 line
Also, .text section (the one that holds all the code) looks to be very
big:
Quoted 1 line
0x06011b85-0x05fe0000=0x31b85(~200kB)
Graeme, Thank you very much.
I know the root cause, the Ethernet driver use lots of address space. I ported the driver from a Linux driver (wireless Linux Ethernet driver), just modified some u-boot incompatible functions. And the codes are very large. I will remove some codes
But when I remove the Ethernet module, I looked the System.map file and found that I can only use 6312 bytes space. It will be difficult for me to reduce the wireless Ethernet driver into 6312bytes. Anyway Thanks for the explanations.
Lance Zhang
[U-Boot] u-boot.lds i686-pc-linux-gnu-ld section .start16 overlapssection .text
Quoted 8 lines · Lance Zhang
Quoted 1 line
Have a look at u-boot.map - This file is generated by the linker and it
will >tell you exactly where it put everything
Quoted 1 line
Also, .text section (the one that holds all the code) looks to be very
big:
Quoted 1 line
0x06011b85-0x05fe0000=0x31b85(~200kB)Graeme, Thank you very much.
Quoted 8 lines
I know the root cause, the Ethernet driver use lots of address space. I ported the driver from a Linux driver (wireless Linux Ethernet driver), just modified some u-boot incompatible functions. And the codes are very large. I will remove some codes
But when I remove the Ethernet module, I looked the System.map file and found that I can only use 6312 bytes space. It will be difficult for me
Hmm, I have 170kB free - minus 128kB (assuming you're using a 128kB flash rather than my 256kB) leaves 42kB, so you are using ~36kB more than my 86kB Looks like you may have some places to carve out some code.
Quoted 2 lines
to reduce the wireless Ethernet driver into 6312bytes. Anyway Thanks for the explanations.
Good luck, glad to be of service
Quoted 2 lines
Lance Zhang
Graeme
[U-Boot] u-boot.lds i686-pc-linux-gnu-ld section .start16 overlapssection .text
Quoted 7 lines
Hmm, I have 170kB free - minus 128kB (assuming you're using a 128kB flash rather than my 256kB) leaves 42kB, so you are using ~36kB more than my 86kB Looks like you may have some places to carve out some code.
Good luck, glad to be of service
I changed the space to 256KB, and build OK. Thanks for all the help
Signature · 2 lines
View this message in context: http://www.nabble.com/u-boot.lds---i686-pc-linux-gnu-ld-section-.start16-overlaps-section-.text-tp20828386p20968976.html Sent from the Uboot - Users mailing list archive at Nabble.com.