[LINKER] Add single underscore to all definitions, no -D for dashed param.
This makes possibility for the script to append the definitions to CFLAGS and LDFLAGS, and with the feature of disabling of -D prependation it will make possible to generate ARCH_FLAGS generic to each specific chip.
This commit is contained in:
committed by
Piotr Esden-Tempski
parent
ea589b9a4e
commit
d15a0e63fe
10
ld/README
10
ld/README
@@ -90,7 +90,10 @@ Line description:
|
||||
"+" - Don't change the parent. Use for split long line to two.
|
||||
|
||||
<data>: space-separated list of preprocessor symbols supplied to the linker.
|
||||
-D option name is automatically prepended to each symbol definition
|
||||
-D option name with single underscore is automatically prepended to each
|
||||
symbol definition
|
||||
if the symbol starts with dash "-", it is interpreted as parameter to
|
||||
linker, and no -D or underscore is generated.
|
||||
|
||||
All lines starting with # symbol are treated as Comments
|
||||
|
||||
@@ -118,14 +121,15 @@ Example:
|
||||
|
||||
--- devices.data file ---
|
||||
stm32f05[01]?4* stm32f0 ROM=16K RAM=4K
|
||||
stm32f0 stm32 ROM_OFF=0x08000000 RAM_OFF=0x20000000
|
||||
stm32f0 stm32 ROM_OFF=0x08000000 RAM_OFF=0x20000000 -mcpu=cortex-m0 -mthumb
|
||||
stm32 END
|
||||
|
||||
--- queried chip name ---
|
||||
stm32f051c4t6
|
||||
|
||||
--- output of the awk script ---
|
||||
-DROM=16K -DRAM=4K -DROM_OFF=0x08000000 -DRAM_OFF=0x20000000
|
||||
-D_ROM=16K -D_RAM=4K -D_ROM_OFF=0x08000000 -D_RAM_OFF=0x20000000 \
|
||||
-mcpu=cortex-m0 -mthumb
|
||||
|
||||
The generated linker script file will contain sections rom and ram with
|
||||
appropriate initialization code, specified in linker file source linker.ld.S
|
||||
|
||||
Reference in New Issue
Block a user