Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

Linker ignores variables.

Here is one to watch out for. If you declare a global variable in bss ...

unsigned int fred;

... then decide to move it to another section, say into NVR somewhwre ...

unsigned int fred __attribute__((section(".nvr")));

... if you fiorget to remove the declaration of the bss variable the linker doesn't seem to mind that there are two variables of the same name. No warning or error is issued. All references to the variable use the one in the named section.

Banx.
No RepliesBe the first to reply