aboutsummaryrefslogtreecommitdiff
path: root/binutils/sysdep.h
AgeCommit message (Collapse)AuthorFilesLines
2022-01-02Update year range in copyright notice of binutils filesAlan Modra1-1/+1
The result of running etc/update-copyright.py --this-year, fixing all the files whose mode is changed by the script, plus a build with --enable-maintainer-mode --enable-cgen-maint=yes, then checking out */po/*.pot which we don't update frequently. The copy of cgen was with commit d1dd5fcc38ead reverted as that commit breaks building of bfp opcodes files.
2021-04-14PR27716, build failure for msdosdjgpp: PATH_MAX undeclaredAlan Modra1-15/+0
We shouldn't be using arbitrary limits like PATH_MAX in GNU programs. This patch also fixes some memory leaks in readelf when processing separate debug info. PR 27716 binutils/ * objdump.c (show_line): Don't limit paths to PATH_MAX. * readelf.c (struct filedata): Change program_interpreter from a char array to a char pointer. (process_program_headers): Sanity check PT_INTERP p_filesz. Malloc program_interpreter using p_filesz and read directly from file. (process_dynamic_section): Check program_interpreter is non-NULL. (free_filedata): New function, split out from.. (process_object): ..here. (close_debug_file): Call free_filedata. * sysdep.h: Don't include sys/param.h. (PATH_MAX): Don't define. * configure.ac: Don't check for sys/param.h. * configure: Regenerate. gprof/ * gprof.h (PATH_MAX): Don't define. * corefile.c (core_create_line_syms): Don't use PATH_MAX for initial file name size. * source.c (annotate_source): Malloc file name buffer. Always trim off "-ann" when dos 8.3 annotate file matches original. * utils.c (print_name_only): Malloc file name buffer.
2021-04-05C99 binutils configuryAlan Modra1-77/+25
* configure.ac: Assume long long is available. Don't test for strings.h, stdlib.h, limits.h, locale.h, or wchar.h. Check inttypes.h, stdint.h, sys/stat.h and sys/types.h. Don't check for strcoll, setlocale, setmode or location of time_t. Don't check for fprintf, getenv, snprintf, strnlen, strstr or vsnprintf decls. (AC_ISC_POSIX, AXC_HEADER_STRING, AC_FUNC_ALLOCA): Don't invoke. * sysdep.h: Don't include alloca-conf.h, include config.h instead. Test HAVE_SYS_TYPES_H and reorder includes. Include limits.h, locale.h, string.h and stdlib.h unconditionally. Remove various fallback declarations. Assume long long is available. * addr2line.c: Don't test HAVE_SETLOCALE. * ar.c: Likewise. * coffdump.c: Likewise. * dlltool.c: Likewise. * dllwrap.c: Likewise. * elfedit.c: Likewise. * nm.c: Likewise. * objcopy.c: Likewise. * objdump.c: Likewise. * readelf.c: Likewise. * size.c: Likewise. * srconv.c: Likewise. * strings.c: Likewise. * sysdump.c: Likewise. * windmc.c: Likewise. * windres.c: Likewise. * bucomm.c: Don't test HAVE_TIME_T_IN_TIME_H or HAVE_TIME_T_IN_TYPES_H. * dwarf.c: Include limits.h unconditionally. Assume long long is available. * nm.c: Don't test HAVE_STRCOLL. * readelf.c: Don't test HAVE_WCHAR_H. * strings.c: Assume long long is available. * syslex.l: Include string.h unconditionally. * aclocal.m4: Regenerate. * config.in: Regenerate. * configure: Regenerate. * Makefile.in: Regenerate. * doc/Makefile.in: Regenerate.
2021-03-31Use bool in binutilsAlan Modra1-0/+2
* sysdep.h (POISON_BFD_BOOLEAN): Define. * addr2line.c, * ar.c, * arsup.c, * bfdtest2.c, * binemul.c, * binemul.h, * bucomm.c, * bucomm.h, * budbg.h, * coffgrok.c, * debug.c, * debug.h, * dlltool.c, * dwarf.c, * dwarf.h, * elfedit.c, * emul_aix.c, * mclex.c, * nm.c, * objcopy.c, * objdump.c, * od-macho.c, * prdbg.c, * rdcoff.c, * rddbg.c, * readelf.c, * rename.c, * stabs.c, * strings.c, * windint.h, * windmc.c, * windmc.h, * windres.c, * winduni.c, * wrstabs.c: Replace bfd_boolean with bool, FALSE with false, and TRUE with true throughout.
2021-01-01Update year range in copyright notice of binutils filesAlan Modra1-1/+1
2020-01-01Update year range in copyright notice of binutils filesAlan Modra1-1/+1
2019-01-01Update year range in copyright notice of binutils filesAlan Modra1-1/+1
2018-01-03Update year range in copyright notice of binutils filesAlan Modra1-1/+1
2017-11-07ngettext supportAlan Modra1-2/+8
binutils has lacked proper pluralization of output messages for a long time, for example, readelf will display information about a section that "contains 1 entries" or "There are 1 section headers". Fixing this properly requires us to use ngettext, because other languages have different rules to English. This patch defines macros for ngettext and friends to handle builds with --disable-nls, and tidies the existing nls support. I've redefined gettext rather than just defining "_" as dgettext in bfd and opcodes in case someone wants to use gettext there (which might conceivably happen with generated code). bfd/ * sysdep.h: Formatting, comment fixes. (gettext, ngettext): Redefine when ENABLE_NLS. (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS. (_): Define using gettext. (textdomain, bindtextdomain): Use safer "do nothing". * hosts/alphavms.h (textdomain, bindtextdomain): Likewise. (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS. opcodes/ * opintl.h: Formatting, comment fixes. (gettext, ngettext): Redefine when ENABLE_NLS. (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS. (_): Define using gettext. (textdomain, bindtextdomain): Use safer "do nothing". binutils/ * sysdep.h (textdomain, bindtextdomain): Use safer "do nothing". (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS. gas/ * asintl.h (textdomain, bindtextdomain): Use safer "do nothing". (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS. gold/ * system.h (textdomain, bindtextdomain): Use safer "do nothing". (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS. ld/ * ld.h (textdomain, bindtextdomain): Use safer "do nothing". (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS.
2017-01-02Update year range in copyright notice of all files.Alan Modra1-1/+1
2016-07-16Don't include libbfd.h outside of bfd, part 3Alan Modra1-0/+8
Fix od-macho.c to use a leb128 function from binutils/dwarf.c rather than one from bfd/libbfd.c. binutils/ * elfcomm.h (HOST_WIDEST_INT): Move to.. * sysdep.h: ..here. * od-macho.c: Don't include libbfd.h. Do include dwarf.h (dump_dyld_info_rebase): Use read_leb128 rather than read_unsigned_leb128. (dump_dyld_info_bind, dump_dyld_info_export_1): Likewise. (dump_segment_split_info): Likewise. (dump_dyld_info): Rename vars to avoid shadowing dwarf.h enums. (dump_load_command): Likewise.
2016-01-01Copyright update for binutilsAlan Modra1-1/+1
2015-01-02ChangeLog rotatation and copyright year updateAlan Modra1-1/+1
2014-03-14Fix build time problem with MingGW hosts, which do not have a strnlen() ↵Nick Clifton1-0/+4
function. 2014-03-13 Meador Inge <meadori@codesourcery.com> * configure.in: Add strnlen to AC_CHECK_DECLS. * config.in: Regenerate. * configure: Regenerate. * sysdep.h (strnlen): Add prototype. * dwarf.c (strnlen): Move prototype ... * sysdep.h (strnlen): ... to here.
2014-03-05Update copyright yearsAlan Modra1-3/+1
2012-05-11 PR binutils/14028Nick Clifton1-0/+5
* configure.in: Invoke ACX_HEADER_STRING. * configure: Regenerate. * config.in: Regenerate. * sysdep.h: If STRINGS_WITH_STRING is defined then include both string.h and strings.h.
2012-02-09 * sysdep.h: Include sys/stat.h here.Alan Modra1-1/+5
* ar.c: Don't include headers already included by sysdep.h. * bucomm.c: Likewise. * budbg.h: Likewise. * dlltool.h: Likewise. * elfedit.c: Likewise. * nlmconv.c: Likewise. * objcopy.c: Likewise. * objdump.c: Likewise. * objdump.h: Likewise. * readelf.c: Likewise. * rename.c: Likewise. * resrc.c: Likewise. * strings.c: Likewise. * windres.c: Likewise. * od-macho.c: Ensure #include sysdep.h is first. * od-xcoff.c: Likewise. * dllwrap.c: Remove alloca pragma handled by sysdep.h, and remove duplicate headers. * dlltool.c: Likewise and ensure #include sysdep.h is first.
2009-03-18include/Alan Modra1-19/+2
* alloca-conf.h: Revise based on autoconf-2.61, autoconf-2.13 documentation. bfd/ * elf32-m68hc1x.c: Include alloca-conf.h. * xsym.c: Likewise. * elf64-hppa.c: Likewise. Remove existing #if's handling alloca. * som.c: Likewise. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. binutils/ * sysdep.h: Include alloca-conf.h instead of config.h and remove existing #if's handling alloca. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. gas/ * as.h: Include alloca-conf.h instead of config.h and remove existing #if's handling alloca. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. opcodes/ * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. * openrisc-opc.c: Regenerate. ld/ * ld.h: Remove alloca handling.
2009-02-032009-02-03 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu1-0/+19
PR binutils/9784 * NEWS: Mention --prefix=PREFIX and --prefix-strip=LEVEL. * doc/binutils.texi: Document --prefix=PREFIX and --prefix-strip=LEVEL. * objdump.c: Include "filenames.h". (prefix): New. (prefix_strip): Likewise. (prefix_length): Likewise. (usage): Add --prefix=PREFIX and --prefix-strip=LEVEL. (option_values): Add OPTION_PREFIX and OPTION_PREFIX_STRIP. (long_options): Likewise. (show_line): Handle prefix and prefix_strip. (main): Handle OPTION_PREFIX and OPTION_PREFIX_STRIP. * readelf.c (PATH_MAX): Moved to ... * sysdep.h: Here.
2008-08-25 * sysdep.h: Include "binary-io.h".Alan Modra1-9/+4
(O_BINARY): Don't define here. * bin2c.c (O_BINARY, O_TEXT, SET_BINARY): Don't define here. * strings.c: Likewise. (main): Remove #ifdef SET_BINARY. * Makefile.am: Run "make dep-am" * Makefile.in: Regenerate.
2008-04-28 PR binutils/6449Nick Clifton1-0/+8
* objdump.c (slurp_file): Open the file in binary mode. * ar.c: Remove conditional definition of O_BINARY. * bin2.c: Likewise. * rename.c: Likewise. * strings.c: Likewise. * sysdep.h: Add conditional definition of O_BINARY.
2007-08-312007-08-31 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu1-1/+1
* Makefile.am (INCLUDES): Remove -D_GNU_SOURCE. * Makefile.in: Regenerated. * sysdep.h: Include "config.h" first.
2007-07-05Change sources over to using GPLv3Nick Clifton1-1/+1
2007-04-26bfd/Alan Modra1-0/+174
Many files: Include sysdep.h before bfd.h. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. binutils/ * bucumm.h: Split off host dependencies to.. * sysdep.h: ..here. Many files: Include sysdep.h. Remove duplicate headers and reorder. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. ld/ Many files: Include sysdep.h first. Remove duplicate headers. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. opcodes/ * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. * ns32k-dis.c: Include sysdep.h first.