Discussion Forum

How to avoid linker ignore undefined symbols?

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
Snaku Lee
Posted
20-Jan-2010 06:41 GMT
Toolset
ARM
New! How to avoid linker ignore undefined symbols?

Hi,
Does anyone know how to avoid linker ignores undefined symbols? My problem is that, when the first time you do the rebuild all, the compiler can know there are undefined symbol, but if you build (i.e. link, not build all) the project, the linker can link it without errors nor warnings. I don't want this potential issues.
Thank you,
Snaku

Read-Only
Author
Tamir Michael
Posted
20-Jan-2010 07:38 GMT
Toolset
ARM
New! RE: How to avoid linker ignore undefined symbols?

it is not a 100% clear to me what the problem is, but try to link with --keep flag, for example:

--keep FIRMWARE_TO_APP_RTX_SIGNAL_ROUTE.o(*)
Read-Only
Author
Snaku Lee
Posted
6-Feb-2010 04:11 GMT
Toolset
ARM
New! RE: How to avoid linker ignore undefined symbols?

Hi Tamir Michael,

Sorry, I did not describe the problem clearly. I write a example code to explain my problem. This example code is no problem when you compile it, but if you change the 'ITEM_2' to 'ITEM_foo' in the test.h, and use 'build target' this protect again (not rebuild all), the compiler will not tell you any thing wrong, only use 'rebuild all' can detect the undefined symbol.
My question is that how to avoid this potential issue when you use 'build target'.

file: test.h

enum{
        ITEM_1,
        ITEM_3
};

file: test.c

#include "test.h"
#include <stdio.h>

int main(void)
{
        printf("ITEM 1 = %d",ITEM_1);
        printf("ITEM 2 = %d",ITEM_2);
}

Thank you,
Snaku

Read-Only
Author
Snaku Lee
Posted
6-Feb-2010 04:16 GMT
Toolset
ARM
New! RE: How to avoid linker ignore undefined symbols?

sorry, the 'test.h' in last message should be

enum{
        ITEM_1,
        ITEM_2
};
Read-Only
Author
Andy Neil
Posted
6-Feb-2010 12:43 GMT
Toolset
ARM
New! What tools are you using, exactly?

They are Keil tools, aren't they?

Please give version numbers.

Read-Only
Author
Snaku Lee
Posted
8-Feb-2010 00:45 GMT
Toolset
ARM
New! RE: What tools are you using, exactly?

Hi Andy Neil,
Yes, I am using Keil RealView MDK-ARM Version 3.50.
Thank you,
Snaku

Next Thread | Thread List | Previous Thread Start a Thread | Settings