diff options
author | Nick Clifton <nickc@redhat.com> | 2004-10-07 14:45:24 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2004-10-07 14:45:24 +0000 |
commit | 8fdd7217a7e29f1ffac4abb2bffbf5a6555b85b7 (patch) | |
tree | 7db6d7732dbeb347e63289055f6daa1a8789a974 /ld/lexsup.c | |
parent | 48c9f030c98a3b53b9cb962857ffc16c435a63db (diff) | |
download | gdb-8fdd7217a7e29f1ffac4abb2bffbf5a6555b85b7.zip gdb-8fdd7217a7e29f1ffac4abb2bffbf5a6555b85b7.tar.gz gdb-8fdd7217a7e29f1ffac4abb2bffbf5a6555b85b7.tar.bz2 |
Add linker option: --warn-shared-textrel to produce warnings when adding a
DT_TEXTREL to a shared object.
Diffstat (limited to 'ld/lexsup.c')
-rw-r--r-- | ld/lexsup.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/ld/lexsup.c b/ld/lexsup.c index 2340006..e40cf62 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -147,6 +147,7 @@ enum option_values OPTION_UNRESOLVED_SYMBOLS, OPTION_WARN_UNRESOLVED_SYMBOLS, OPTION_ERROR_UNRESOLVED_SYMBOLS, + OPTION_WARN_SHARED_TEXTREL, OPTION_REDUCE_MEMORY_OVERHEADS }; @@ -304,6 +305,18 @@ static const struct ld_option ld_options[] = OPTION_NO_ACCEPT_UNKNOWN_INPUT_ARCH}, '\0', NULL, N_("Reject input files whose architecture is unknown"), TWO_DASHES }, + { {"add-needed", no_argument, NULL, OPTION_ADD_NEEDED}, + '\0', NULL, N_("Set DT_NEEDED tags for DT_NEEDED entries in\n" + "\t\t\t\tfollowing dynamic libs"), TWO_DASHES }, + { {"no-add-needed", no_argument, NULL, OPTION_NO_ADD_NEEDED}, + '\0', NULL, N_("Do not set DT_NEEDED tags for DT_NEEDED entries\n" + "\t\t\t\tin following dynamic libs"), TWO_DASHES }, + { {"as-needed", no_argument, NULL, OPTION_AS_NEEDED}, + '\0', NULL, N_("Only set DT_NEEDED for following dynamic libs if used"), + TWO_DASHES }, + { {"no-as-needed", no_argument, NULL, OPTION_NO_AS_NEEDED}, + '\0', NULL, N_("Always set DT_NEEDED for following dynamic libs"), + TWO_DASHES }, { {"assert", required_argument, NULL, OPTION_ASSERT}, '\0', N_("KEYWORD"), N_("Ignored for SunOS compatibility"), ONE_DASH }, { {"Bdynamic", no_argument, NULL, OPTION_CALL_SHARED}, @@ -337,6 +350,9 @@ static const struct ld_option ld_options[] = TWO_DASHES }, { {"embedded-relocs", no_argument, NULL, OPTION_EMBEDDED_RELOCS}, '\0', NULL, N_("Generate embedded relocs"), TWO_DASHES}, + { {"fatal-warnings", no_argument, NULL, OPTION_WARN_FATAL}, + '\0', NULL, N_("Treat warnings as errors"), + TWO_DASHES }, { {"fini", required_argument, NULL, OPTION_FINI}, '\0', N_("SYMBOL"), N_("Call SYMBOL at unload-time"), ONE_DASH }, { {"force-exe-suffix", no_argument, NULL, OPTION_FORCE_EXE_SUFFIX}, @@ -476,30 +492,18 @@ static const struct ld_option ld_options[] = { {"warn-section-align", no_argument, NULL, OPTION_WARN_SECTION_ALIGN}, '\0', NULL, N_("Warn if start of section changes due to alignment"), TWO_DASHES }, + { {"warn-shared-textrel", no_argument, NULL, OPTION_WARN_SHARED_TEXTREL}, + '\0', NULL, N_("Warn if shared object has DT_TEXTREL"), + TWO_DASHES }, { {"warn-unresolved-symbols", no_argument, NULL, OPTION_WARN_UNRESOLVED_SYMBOLS}, '\0', NULL, N_("Report unresolved symbols as warnings"), TWO_DASHES }, { {"error-unresolved-symbols", no_argument, NULL, OPTION_ERROR_UNRESOLVED_SYMBOLS}, '\0', NULL, N_("Report unresolved symbols as errors"), TWO_DASHES }, - { {"fatal-warnings", no_argument, NULL, OPTION_WARN_FATAL}, - '\0', NULL, N_("Treat warnings as errors"), - TWO_DASHES }, { {"whole-archive", no_argument, NULL, OPTION_WHOLE_ARCHIVE}, '\0', NULL, N_("Include all objects from following archives"), TWO_DASHES }, - { {"add-needed", no_argument, NULL, OPTION_ADD_NEEDED}, - '\0', NULL, N_("Set DT_NEEDED tags for DT_NEEDED entries in\n" - "\t\t\t\tfollowing dynamic libs"), TWO_DASHES }, - { {"no-add-needed", no_argument, NULL, OPTION_NO_ADD_NEEDED}, - '\0', NULL, N_("Do not set DT_NEEDED tags for DT_NEEDED entries\n" - "\t\t\t\tin following dynamic libs"), TWO_DASHES }, - { {"as-needed", no_argument, NULL, OPTION_AS_NEEDED}, - '\0', NULL, N_("Only set DT_NEEDED for following dynamic libs if used"), - TWO_DASHES }, - { {"no-as-needed", no_argument, NULL, OPTION_NO_AS_NEEDED}, - '\0', NULL, N_("Always set DT_NEEDED for following dynamic libs"), - TWO_DASHES }, { {"wrap", required_argument, NULL, OPTION_WRAP}, '\0', N_("SYMBOL"), N_("Use wrapper functions for SYMBOL"), TWO_DASHES }, }; @@ -1214,6 +1218,9 @@ parse_args (unsigned argc, char **argv) case OPTION_WARN_SECTION_ALIGN: config.warn_section_align = TRUE; break; + case OPTION_WARN_SHARED_TEXTREL: + link_info.warn_shared_textrel = TRUE; + break; case OPTION_WHOLE_ARCHIVE: whole_archive = TRUE; break; |