+ obstack_1grow(&ldflags_obst, '\0');
+ const char *flags = obstack_finish(&ldflags_obst);
+
+ /* construct commandline */
+ obstack_printf(&file_obst, "%s", LINKER);
+ for (file_list_entry_t *entry = files; entry != NULL;
+ entry = entry->next) {
+ if (entry->type != FILETYPE_OBJECT)
+ continue;
+
+ add_flag(&file_obst, "%s", entry->name);
+ }
+
+ add_flag(&file_obst, "-o");
+ add_flag(&file_obst, outname);
+ obstack_printf(&file_obst, "%s", flags);
+ obstack_1grow(&file_obst, '\0');
+
+ char *commandline = obstack_finish(&file_obst);
+
+ if(verbose) {
+ puts(commandline);
+ }
+ int err = system(commandline);
+ if(err != EXIT_SUCCESS) {
+ fprintf(stderr, "linker reported an error\n");
+ exit(1);
+ }