diff options
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 15 | ||||
-rw-r--r-- | ld/NEWS | 3 | ||||
-rw-r--r-- | ld/config.in | 3 | ||||
-rwxr-xr-x | ld/configure | 25 | ||||
-rw-r--r-- | ld/configure.ac | 16 | ||||
-rw-r--r-- | ld/ld.texinfo | 3 | ||||
-rw-r--r-- | ld/ldmain.c | 3 | ||||
-rw-r--r-- | ld/lexsup.c | 7 |
8 files changed, 73 insertions, 2 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 2489e1e..e59e9f8 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,18 @@ +2015-10-21 Nick Clifton <nickc@redhat.com> + + PR gas/19109 + * configure.ac: Add --enable-compressed-debug-sections. + * configure: Regenerate. + * config.in: Regenerate. + * ld.texinfo: Document how to determine the default action for + debug sections. + * ldmain.c (main): If DEFAULT_FLAG_COMPRESS_DEBUG is defined then + set the compress_debug field of the link_info structure to + zlib-gabi. + * lexsup.c (elf_static_list_options): Output the default setting + for the --compress-debug-sections option. + * NEWS: Mention the new configure option. + 2015-10-15 H.J. Lu <hongjiu.lu@intel.com> * ld.texinfo: Fix a typo for "-z noextern-protected-data". @@ -1,5 +1,8 @@ -*- text -*- +* Add a configure option --enable-compressed-debug-sections={all,ld} to + decide whether DWARF debug sections should be compressed by default. + * Add support for the ARC EM/HS, and ARC600/700 architectures. * Experimental support for linker garbage collection (--gc-sections) diff --git a/ld/config.in b/ld/config.in index a9a37e0..276fb77 100644 --- a/ld/config.in +++ b/ld/config.in @@ -7,6 +7,9 @@ #endif #define __CONFIG_H__ 1 +/* Define if you want compressed debug sections by default. */ +#undef DEFAULT_FLAG_COMPRESS_DEBUG + /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS diff --git a/ld/configure b/ld/configure index 1249852..c068f6f 100755 --- a/ld/configure +++ b/ld/configure @@ -788,6 +788,7 @@ enable_64_bit_bfd with_sysroot enable_gold enable_got +enable_compressed_debug_sections enable_werror enable_build_warnings enable_nls @@ -1444,6 +1445,7 @@ Optional Features: --enable-gold[=ARG] build gold [ARG={default,yes,no}] --enable-got=<type> GOT handling scheme (target, single, negative, multigot) + --enable-compressed-debug-sections compress debug sections by default --enable-werror treat compile warnings as errors --enable-build-warnings enable build-time compiler warnings --disable-nls do not use Native Language Support @@ -11713,7 +11715,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11716 "configure" +#line 11718 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11819,7 +11821,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11822 "configure" +#line 11824 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15521,6 +15523,19 @@ $as_echo "#define GOT_HANDLING_DEFAULT GOT_HANDLING_MULTIGOT" >>confdefs.h *) as_fn_error "bad value ${got_handling} for --enable-got option" "$LINENO" 5 ;; esac +# PR gas/19109 +# Decide the default method for compressing debug sections. +ac_default_compressed_debug_sections=unset +# Provide a configure time option to override our default. +# Check whether --enable-compressed_debug_sections was given. +if test "${enable_compressed_debug_sections+set}" = set; then : + enableval=$enable_compressed_debug_sections; case "${enableval}" in + yes | all | ld) ac_default_compressed_debug_sections=yes ;; + no | none) ac_default_compressed_debug_sections=no ;; + *) ac_default_compressed_debug_sections=unset ;; +esac +fi + # Set the 'development' global. . $srcdir/../bfd/development.sh @@ -17118,6 +17133,12 @@ do fi done +if test x$ac_default_compressed_debug_sections == xyes ; then + +$as_echo "#define DEFAULT_FLAG_COMPRESS_DEBUG 1" >>confdefs.h + +fi + diff --git a/ld/configure.ac b/ld/configure.ac index e1d2c81..8a9ce2b 100644 --- a/ld/configure.ac +++ b/ld/configure.ac @@ -143,6 +143,18 @@ case "${got_handling}" in *) AC_MSG_ERROR(bad value ${got_handling} for --enable-got option) ;; esac +# PR gas/19109 +# Decide the default method for compressing debug sections. +ac_default_compressed_debug_sections=unset +# Provide a configure time option to override our default. +AC_ARG_ENABLE(compressed_debug_sections, +[ --enable-compressed-debug-sections compress debug sections by default], +[case "${enableval}" in + yes | all | ld) ac_default_compressed_debug_sections=yes ;; + no | none) ac_default_compressed_debug_sections=no ;; + *) ac_default_compressed_debug_sections=unset ;; +esac])dnl + AM_BINUTILS_WARNINGS AM_LC_MESSAGES @@ -372,6 +384,10 @@ do fi done +if test x$ac_default_compressed_debug_sections == xyes ; then + AC_DEFINE(DEFAULT_FLAG_COMPRESS_DEBUG, 1, [Define if you want compressed debug sections by default.]) +fi + AC_SUBST(elf_list_options) AC_SUBST(elf_shlib_list_options) AC_SUBST(elf_plt_unwind_list_options) diff --git a/ld/ld.texinfo b/ld/ld.texinfo index 17cd479..6376055 100644 --- a/ld/ld.texinfo +++ b/ld/ld.texinfo @@ -2275,6 +2275,9 @@ sections and rename debug section names to begin with @samp{.zdebug} instead of @samp{.debug}. @option{--compress-debug-sections=zlib} and @option{--compress-debug-sections=zlib-gabi} compress DWARF debug sections with SHF_COMPRESSED from the ELF ABI. +The default behaviour varies depending upon the target involved and +the configure options used to build the toolchain. The default can be +determined by examing the output from the linker's @option{--help} option. @kindex --reduce-memory-overheads @item --reduce-memory-overheads diff --git a/ld/ldmain.c b/ld/ldmain.c index 96d7fe8..bb0b9cc 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -281,6 +281,9 @@ main (int argc, char **argv) link_info.pei386_auto_import = -1; link_info.spare_dynamic_tags = 5; link_info.path_separator = ':'; +#ifdef DEFAULT_FLAG_COMPRESS_DEBUG + link_info.compress_debug = COMPRESS_DEBUG_GABI_ZLIB; +#endif ldfile_add_arch (""); emulation = get_emulation (argc, argv); diff --git a/ld/lexsup.c b/ld/lexsup.c index fdd39a7..1dcbf4c 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -1756,6 +1756,13 @@ elf_static_list_options (FILE *file) fprintf (file, _("\ --compress-debug-sections=[none|zlib|zlib-gnu|zlib-gabi]\n\ Compress DWARF debug sections using zlib\n")); +#ifdef DEFAULT_FLAG_COMPRESS_DEBUG + fprintf (file, _("\ + Default: zlib-gabi\n")); +#else + fprintf (file, _("\ + Default: none\n")); +#endif fprintf (file, _("\ -z common-page-size=SIZE Set common page size to SIZE\n")); fprintf (file, _("\ |