From: Oleg E. <ole...@t-...> - 2024-04-10 05:57:23
|
On Tue, 2024-04-09 at 09:00 +0200, Steve Schnepp wrote: > On Tue, Apr 9, 2024, 01:56 Oleg Endo <ole...@t-...> wrote: > > > which will put each function and data item into its own ELF section. Then > > the linker can figure out which sections are used and which ones are not > > used. > > With sdcc, a common way to optimize it is to have as many .c files as items one wants to be pruned. > > I think the stdlib is implemented that way. > That's right. Traditionally it's been like that -- the linker would eliminate whole translation units, if they're determined to be not referenced. For this reason the runtime library implementations usually follow the 1 function per 1 .c file pattern. Depending on the application structure it might make the code difficult to work with if all data variables are split out into single .c files. But yeah, that's the only working thing on SDCC at this time. Best regards, Oleg Endo |