Create and write library to libbuf. The library consists of: library header object modules... dictionary header dictionary pages...
Add object module or library to the library. Examine the buffer to see which it is. If the buffer is NULL, use module_name as the file name and load the file.
Set the library file name based on the output directory and the filename. Add default library file name extension.