* src/pic16/glue.c (pic16_emitRegularMap): unused functions marked as
[fw/sdcc] / src / pic16 / glue.c
index d92db723a0c14a7db1372b63935921910e61b88a..f59f1536014df40d7ed4d53c53e100e494ec9ad3 100644 (file)
@@ -142,6 +142,12 @@ pic16emitRegularMap (memmap * map, bool addPublics, bool arFlag)
 
                /* if extern then add to externs */
                if (IS_EXTERN (sym->etype)) {
+                       
+                       /* reduce overhead while linking by not declaring
+                        * extern unused external functions (usually declared
+                        * in header files) */
+                       if(IS_FUNC(sym->type) && !sym->used)continue;
+                       
                        checkAddSym(&externs, sym);
                        continue;
                }