Minor ld script changes.
Add wildcards to the input section names. This fixes the script for use with the "-ffunction-sections -fdata-sections -Wl,--gc-sections" options when compiling/linking. Also, discard the .eh_frame section. This section is emitted by GCC 4.4, but not 4.5. Discarding it doesn't appear to break anything. I suspect this is used for C++ exception implementation. I found this to be a problem when building with GCC 4.4 (arm-elf), because the USB DFU demo exceeded the 8k I allowed for it. Thanks to Gareth McMullin <gareth@blacksphere.co.nz> for the patch.
This commit is contained in:
parent
4ef35380e8
commit
af61aaef21
@ -31,8 +31,8 @@ SECTIONS
|
||||
|
||||
.text : {
|
||||
*(.vectors) /* Vector table */
|
||||
*(.text) /* Program code */
|
||||
*(.rodata) /* Read-only data */
|
||||
*(.text*) /* Program code */
|
||||
*(.rodata*) /* Read-only data */
|
||||
_etext = .;
|
||||
} >rom
|
||||
|
||||
@ -40,16 +40,22 @@ SECTIONS
|
||||
|
||||
.data : {
|
||||
_data = .;
|
||||
*(.data) /* Read-write initialized data */
|
||||
*(.data*) /* Read-write initialized data */
|
||||
_edata = .;
|
||||
} >ram AT >rom
|
||||
|
||||
.bss : {
|
||||
*(.bss) /* Read-write zero initialized data */
|
||||
*(.bss*) /* Read-write zero initialized data */
|
||||
*(COMMON)
|
||||
_ebss = .;
|
||||
} >ram AT >rom
|
||||
|
||||
/*
|
||||
* The .eh_frame section appears to be used for C++ exception handling.
|
||||
* You may need to fix this if you're using C++.
|
||||
*/
|
||||
/DISCARD/ : { *(.eh_frame) }
|
||||
|
||||
end = .;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user