From 2dc23e0157138d12423ae15f8b18e1e5e56aeb14 Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 17 Feb 2024 06:32:48 +0000 Subject: ar mode: utility: version script printing: added the -Wmapfile switch. --- src/internal/slibtool_driver_impl.h | 1 + src/logic/slbt_exec_ar.c | 11 +++++++++++ src/skin/slbt_skin_ar.c | 8 ++++++++ 3 files changed, 20 insertions(+) (limited to 'src') diff --git a/src/internal/slibtool_driver_impl.h b/src/internal/slibtool_driver_impl.h index 848aa94..a2e079d 100644 --- a/src/internal/slibtool_driver_impl.h +++ b/src/internal/slibtool_driver_impl.h @@ -89,6 +89,7 @@ enum app_tags { TAG_AR_VERSION, TAG_AR_CHECK, TAG_AR_PRINT, + TAG_AR_MAPFILE, TAG_AR_REGEX, TAG_AR_PRETTY, TAG_AR_POSIX, diff --git a/src/logic/slbt_exec_ar.c b/src/logic/slbt_exec_ar.c index 8f6016f..35c8380 100644 --- a/src/logic/slbt_exec_ar.c +++ b/src/logic/slbt_exec_ar.c @@ -103,6 +103,10 @@ static int slbt_exec_ar_perform_archive_actions( if (dctx->cctx->fmtflags & SLBT_OUTPUT_ARCHIVE_SYMBOLS) if (slbt_ar_output_symbols((*arctxp)->meta) < 0) return SLBT_NESTED_ERROR(dctx); + + if (dctx->cctx->fmtflags & SLBT_OUTPUT_ARCHIVE_MAPFILE) + if (slbt_ar_output_mapfile((*arctxp)->meta) < 0) + return SLBT_NESTED_ERROR(dctx); } if (dctx->cctx->drvflags & SLBT_DRIVER_MODE_AR_MERGE) { @@ -235,6 +239,10 @@ int slbt_exec_ar( break; + case TAG_AR_MAPFILE: + ictx->cctx.fmtflags |= SLBT_OUTPUT_ARCHIVE_MAPFILE; + break; + case TAG_AR_REGEX: ictx->cctx.regex = entry->arg; break; @@ -285,6 +293,9 @@ int slbt_exec_ar( if (cctx->fmtflags & SLBT_DRIVER_MODE_AR_OUTPUTS) { (void)0; + } else if (cctx->fmtflags & SLBT_OUTPUT_ARCHIVE_MAPFILE) { + (void)0; + } else if (!(cctx->drvflags & SLBT_DRIVER_MODE_AR_ACTIONS)) { if (cctx->drvflags & SLBT_DRIVER_VERBOSITY_ERRORS) slbt_dprintf(fderr, diff --git a/src/skin/slbt_skin_ar.c b/src/skin/slbt_skin_ar.c index 58059aa..edd4247 100644 --- a/src/skin/slbt_skin_ar.c +++ b/src/skin/slbt_skin_ar.c @@ -36,6 +36,14 @@ const struct argv_option slbt_ar_options[] = { "print out information pertaining to each archive file " "and its various internal elements"}, + {"Wmapfile", 0,TAG_AR_MAPFILE,ARGV_OPTARG_NONE, + ARGV_OPTION_HYBRID_ONLY, + 0,0, + "print out a map file (aka symbol file, aka version script); " + "including either all armap symbols (if no regex filter was " + "specified), or otherwise only the symbols that match the " + "specified regex filter."}, + {"Wregex", 0,TAG_AR_REGEX,ARGV_OPTARG_REQUIRED, ARGV_OPTION_HYBRID_ONLY|ARGV_OPTION_HYBRID_SPACE, 0,"", -- cgit v1.2.3