Has anyone else tried C51 v6.20/uVision v2.20? In one of my 'C' source files with inline assembler, the new Compiler now creates an empty DATA Segment in the generated assembler. This causes the Link to fail with Error L109, "Empty Relocatable Segment" According to the online help & the PDF manual, L109 should not be a fatal error; the Segment should simply be ignored. So there are two issues here: A. Why does the new compiler generate the empty Segment? B. Why does the BL51 Link fail, when this should not be a Fatal error? (the behaviour is the same for both the v4.14 & v4.20 Linkers).
I am currently experiencing exactly the same problem. The compiler is adding additional lines to my .a51 file and as you say, the linker is complaining. A temporary (but not good) fix is to remove the unwanted lines. The output file can then be built as normal. Have you had a solution from Keil? I would be grateful if you could pass on any information.
Does anybody have a solution for this Non-fatal error L109 of v6.20. Shall be gratefull, if you could share the information.
I have sent this info through to Keil for an answer... I am currently using the Keil compiler C51 (V6.23a) and linker BL51 (V4.23). I recently upgraded to this version of compiler and linker and am now getting the 'Error L109, "Empty Relocatable Segment"' error on a file that was previously compiling and linking perfectly. The Problem: I have a file with the following compiler settings selected "Generate Assembler SRC File" & "Assemble SRC File". What I see the problem code being is as follows:
**************** static void GenFac (unsigned char xdata *key, unsigned char xdata *fac_ptr) small { unsigned char xdata fac[8]; unsigned char i=0,j=0; ****************
**************** ?XD?SMGF_Request?REQSMGF SEGMENT XDATA OVERLAYABLE ?XD?_GenFac?REQSMGF SEGMENT XDATA OVERLAYABLE EXTRN XDATA (cvt_conversion_error) ... RSEG ?DT?_GenFac?REQSMGF ?_GenFac?BYTE: key?040: DS 2 fac_ptr?041: DS 2 fac?042: DS 8 ****************
I have found the reason for this problem I have been having. I noticed that the function was declared with the directive small (small memory model):
**************** static void GenFac (unsigned char xdata *key, unsigned char xdata *fac_ptr) small ****************
I have a large code settings for my project. The following code generated L109 error: typedef union tagLONGLONG{ struct{ unsigned short hi; unsigned long lo; } LL; unsigned char bytes[6]; unsigned short words[3]; } LONGLONG; void ZeroLONGLONG(LONGLONG xdata *v) { v->LL.hi=0; v->LL.lo=0; } This fix shuts down the error: void ZeroLONGLONG(LONGLONG xdata *v) { char xdata i; //dummy fix v->LL.hi=0; v->LL.lo=0; }