Almost all the modules of the library are in the segments LIB_CODE and LDIV, but i don't know if we can separate some modules from these segments. Can we do it? And if yes, how can i do it?
You're not quite getting me yet. The trick you're missing is that you will have to have *two* copies of that library segment: one in the firmware part of the program, the other in the program it downloads into the flash. Essentially, you'll have to build the firmware and the linker as self-contained separate projects, including separate linker runs for each of them.