mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-02 06:23:18 +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:
4
ichspi.c
4
ichspi.c
@ -948,10 +948,10 @@ int ich_spi_send_multicommand(struct spi_command *cmds)
|
||||
|
||||
static void do_ich9_spi_frap(uint32_t frap, int i)
|
||||
{
|
||||
const char *access_names[4] = {
|
||||
static const char *const access_names[4] = {
|
||||
"locked", "read-only", "write-only", "read-write"
|
||||
};
|
||||
const char *region_names[5] = {
|
||||
static const char *const region_names[5] = {
|
||||
"Flash Descriptor", "BIOS", "Management Engine",
|
||||
"Gigabit Ethernet", "Platform Data"
|
||||
};
|
||||
|
Reference in New Issue
Block a user