+
+ case OPTION_DEPENDENCY_FILE:
+ config.dependency_file = optarg;
+ break;
+
+ case OPTION_CTF_VARIABLES:
+ config.ctf_variables = TRUE;
+ break;
+
+ case OPTION_NO_CTF_VARIABLES:
+ config.ctf_variables = FALSE;
+ break;
+
+ case OPTION_CTF_SHARE_TYPES:
+ if (strcmp (optarg, "share-unconflicted") == 0)
+ config.ctf_share_duplicated = FALSE;
+ else if (strcmp (optarg, "share-duplicated") == 0)
+ config.ctf_share_duplicated = TRUE;
+ else
+ einfo (_("%F%P: bad --ctf-share-types option: %s\n"), optarg);
+ break;
+ }
+ }
+
+ /* Run a couple of checks on the map filename. */
+ if (config.map_filename)
+ {
+ if (config.map_filename[0] == 0)
+ {
+ einfo (_("%P: no file/directory name provided for map output; ignored\n"));
+ config.map_filename = NULL;
+ }
+ else
+ {
+ struct stat s;
+
+ /* If the map filename is actually a directory then create
+ a file inside it, based upon the output filename. */
+ if (stat (config.map_filename, &s) >= 0
+ && S_ISDIR (s.st_mode))
+ {
+ char * new_name;
+
+ /* FIXME: This is a (trivial) memory leak. */
+ if (asprintf (&new_name, "%s/%s.map",
+ config.map_filename, output_filename) < 0)
+ {
+ /* If this alloc fails then something is probably very
+ wrong. Better to halt now rather than continue on
+ into more problems. */
+ einfo (_("%P%F: cannot create name for linker map file: %E\n"));
+ new_name = NULL;
+ }
+
+ config.map_filename = new_name;
+ }