 | Discussion Forum |  |
|
|
Uncalled Segment/DATA overflowNext Thread | Thread List | Previous Thread Start a Thread | Settings | Details | Message |
|---|
Read-Only Author Simon Fisher Posted 5-Mar-2001 09:40 GMT Toolset C51 |  Uncalled Segment/DATA overflow Simon Fisher Does anyone know how to avoid a data segment overflow caused by the local data for uncalled functions being permanently allocated? Better still to prevent such functions being included in the final output at all?
I am using Keil C51 V6.
Thanks Simon Fisher | | Read-Only Author Andrew Neil Posted 5-Mar-2001 11:32 GMT Toolset C51 |  RE: Uncalled Segment/DATA overflow Andrew Neil Are they really not called, or just calls that the linker can't "See;" eg, Interrupt Service Routines?
If they really aren't called, why are you building them!?
Could you put your locals in PDATA or XDATA?
Take a look at App Note 129, "Function Pointers in C51" and knowledge base article, "C51: Problems with function pointers overwriting variables" http://www.keil.com/support/docs/210.htm They include some examples on how to manually adjust the overlaying yourself | | Read-Only Author Simon Fisher Posted 5-Mar-2001 11:39 GMT Toolset C51 |  RE: Uncalled Segment/DATA overflow Simon Fisher Sorry I didn't explain myself very well. I meant function that aren't actually used at all, and are there because more than one project uses the same source file, some functions being required by one project and not the other. The problem is that the local (auto) data in an uncalled function is being allocated out of DATA (not DATA_GROUP). It would also be nice if uncalled functions were not included in the ROM image at all. | | Read-Only Author Andrew Neil Posted 5-Mar-2001 12:13 GMT Toolset C51 |  RE: Uncalled Segment/DATA overflow Andrew Neil How about some #ifs to prevent building functions not required for the particular project?
Or maybe move the functions to separate files, so that each project only includes those files which it actually needs.
Otherwise, my previous suggestions of moving the locals or manually adjusting the overlaying? | | Read-Only Author Alex Ruiz Posted 5-Mar-2001 13:57 GMT Toolset C51 |  RE: Uncalled Segment/DATA overflow Alex Ruiz ...some functions being required by one project and not the other
If you know what modules are going to use the specific function, can't you use pre-processing to enable or disable the function in question?
#ifdef i_want_it
//Yor fuction here
#endif
- Alex | | Read-Only Author Franc Urbanc Posted 5-Mar-2001 19:29 GMT Toolset C51 |  RE: Uncalled Segment/DATA overflow Franc Urbanc If used frequently it is a good practice to build a custom library and header file. Then the linker will include only the required function modules, unused will not be initialized and included in your ROM file. | |
Next Thread | Thread List | Previous Thread Start a Thread | Settings |
|