1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-06-30 21:52:36 +02:00

Convince compilers to put constant data into the .rodata section

This patch reduces the stack usage by declaring 'const' stack variables
as 'static const' so they end up in the .rodata section instead of being
copied from there to the stack for every invocation of the corresponding
function.

As a plus we end up in having a smaller binary as the "copy from .rodata
to stack" code isn't emitted by the compiler any more (roughly -100
bytes).

Corresponding to flashrom svn r1252.

Signed-off-by: Mathias Krause <mathias.krause@secunet.com>
Acked-by: Stefan Reinauer <stepan@coreboot.org>
This commit is contained in:
Mathias Krause
2011-01-17 07:50:42 +00:00
parent 2c3afa34fc
commit a60faab83e
8 changed files with 26 additions and 26 deletions

View File

@ -188,7 +188,7 @@ enum write_granularity {
};
extern enum chipbustype buses_supported;
extern int verbose;
extern const char * const flashrom_version;
extern const char flashrom_version[];
extern char *chip_to_probe;
void map_flash_registers(struct flashchip *flash);
int read_memmapped(struct flashchip *flash, uint8_t *buf, int start, int len);