Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Linker ignores variables.

Altera_Forum
Honored Contributor II
1,008 Views

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.
0 Kudos
0 Replies
Reply