aboutsummaryrefslogtreecommitdiff
path: root/binutils/doc
AgeCommit message (Collapse)AuthorFilesLines
2022-11-28PR10368, ISO 8859 mentioned as 7bit encoding in strings documentationAlan Modra1-1/+1
PR 10368 * doc/binutils.texi (strings): Delete example of 7-bit encoding.
2022-11-21Fix ARM and AArch64 assembler tests to work in a multi-arch environment.Nick Clifton1-0/+6
PR 29764 gas * testsuite/gas/arm/cpu-cortex-a76ae.d: Add arm prefix to the -m option passed to objdump. * testsuite/gas/arm/cpu-cortex-a77.d: Likewise. * testsuite/gas/aarch64/cpu-cortex-a76ae.d: Add aarch64 prefix to the -m option passed to objdump. * testsuite/gas/aarch64/cpu-cortex-a77.d: Likewise. bfd * cpu-arm.c (scan): Accept machine names prefixed with "arm:". * cpu-aarch64.c (scan): Accept machine names prefixed with "aarch64:". bin * doc/binutils.texi (objdump): Note that the -m option supports the <architecture>:<machine> syntax.
2022-11-15readelf/objdump: support for SFrame sectionIndu Bhagat2-0/+14
This patch adds support for SFrame in readelf and objdump. The arguments of --sframe are optional for both readelf and objdump. include/ChangeLog: * sframe-api.h (dump_sframe): New function declaration. ChangeLog: * binutils/Makefile.am: Add dependency on libsframe for readelf and objdump. * binutils/Makefile.in: Regenerate. * binutils/doc/binutils.texi: Document --sframe=[section]. * binutils/doc/sframe.options.texi: New file. * binutils/objdump.c: Add support for SFrame format. * binutils/readelf.c: Likewise. * include/sframe-api.h: Add new API for dumping .sframe section. * libsframe/Makefile.am: Add sframe-dump.c. * libsframe/Makefile.in: Regenerate. * libsframe/sframe-dump.c: New file.
2022-10-31objdump: Add configure time option to enable colored disassembly output by ↵Nick Clifton1-11/+19
default. PR 29457 * configure.ac: Add --enable-colored-disassembly. * objdump.c: Add --disassembler-color=terminal. * doc/binutils.texi (objdump): Document the new option. * NEWS: Mention new feature. * config.in: Regenerate in. * configure: Regenerate.
2022-10-20binutils: Remove unused substitution PROGRAMTsukasa OI1-2/+1
Unlike other substitution, this substitution of @PROGRAM@ was done in binutils/Makefile and it was intended for binutils/cxxfilt.man. @PROGRAM@ in binutils/cxxfilt.man is removed in the commit 0285c67df190 ("Automate generate on man pages") in 2001 and @PROGRAM@ is ineffective since then. Because PROGRAM substitution does nothing, removing this manual substitution should be completely safe. binutils/ChangeLog: * doc/local.mk: Remove unused substitution PROGRAM. * Makefile.in: Regenerate.
2022-10-14e200 LSP supportAlan Modra1-4/+5
It has bothered me for a long time that we have disabled LSP (and SPE) tests. Also the LSP test comment indicating there is something wrong with get_powerpc_dialect. I don't think there is. Decoding of a VLE instruction depends on whether the processor is in VLE mode (some processors support both VLE and standard PPC) which we flag per section with SHF_PPC_VLE for decoding when disassembling. Background: Some versions of powerpc e200 have "Lightweight Signal Processing" support, examples being e200z215 and e200z425. As far as I can tell, LSP and SPE are mutually exclusive. This seems to be borne out by insn encoding, for example LSP "zvaddih" and SPE "evaddw" have the same encoding. So none of the processor descriptions in ppc_opts ought to have both PPC_OPCODE_LSP and PPC_OPCODE_SPE/2, if we want disassembly to work. I also could not find anything to suggest that the LSP insns are enabled only in VLE mode, which means the LSP insns should not be in vle_opcodes. Fix all this by moving the LSP insns to their own table, and add a new e200z2 cpu entry with LSP support, removing LSP from -me200z4 and from -mvle. (Yes, I know, as I said above some of the e200z4 processors have LSP. Others have SPE. It's hard to choose good options. Think of z2 as meaning earlier, z4 as later.) Also add -mlsp to allow adding the LSP insn set. include/ * opcode/ppc.h (lsp_opcodes, lsp_num_opcodes): Declare. (LSP_OP_TO_SEG): Define. binutils/ * doc/binutils.texi: Update ppc docs. gas/ * config/tc-ppc.c (ppc_setup_opcodes): Add lsp opcodes to ppc_hash. * doc/c-ppc.texi: Document e200 and lsp. * testsuite/gas/ppc/lsp-checks.d: Assemble with -me200z2. * testsuite/gas/ppc/lsp.d: Likewise, disassembly too. * testsuite/gas/ppc/ppc.exp: Don't xfail lsp test. opcodes/ * ppc-dis.c (ppc_opts): Add e200z2 and lsp. Don't set PPC_OPCODE_LSP for e200z4 or vle. (ppc_parse_cpu): Mutually exclude LSP and SPE. (LSP_OPCD_SEGS): Define. (lsp_opcd_indices): New array. (disassemble_init_powerpc): Init lsp_opcd_indices. (lookup_lsp): New function. (print_insn_powerpc): Call it. * ppc-opc.c: Include libiberty.h for ARRAY_SIZE and use throughout. (vle_opcodes): Move LSP opcodes to.. (lsp_opcodes): ..here, and sort. (lsp_num_opcodes): New.
2022-09-28The help document of size misses an option.Nick Clifton1-0/+10
PR 29628 * size.c (usage): Add -f. * doc/binutils.texi (size): Add -f.
2022-09-26binutils, gdb: support zstd compressed debug sectionsFangrui Song1-7/+9
PR29397 PR29563: Add new configure option --with-zstd which defaults to auto. If pkgconfig/libzstd.pc is found, define HAVE_ZSTD and support zstd compressed debug sections for most tools. * bfd: for addr2line, objdump --dwarf, gdb, etc * gas: support --compress-debug-sections=zstd * ld: support ELFCOMPRESS_ZSTD input and --compress-debug-sections=zstd * objcopy: support ELFCOMPRESS_ZSTD input for --decompress-debug-sections and --compress-debug-sections=zstd * gdb: support ELFCOMPRESS_ZSTD input. The bfd change references zstd symbols, so gdb has to link against -lzstd in this patch. If zstd is not supported, ELFCOMPRESS_ZSTD input triggers an error. We can avoid HAVE_ZSTD if binutils-gdb imports zstd/ like zlib/, but this is too heavyweight, so don't do it for now. ``` % ld/ld-new a.o ld/ld-new: a.o: section .debug_abbrev is compressed with zstd, but BFD is not built with zstd support ... % ld/ld-new a.o --compress-debug-sections=zstd ld/ld-new: --compress-debug-sections=zstd: ld is not built with zstd support % binutils/objcopy --compress-debug-sections=zstd a.o b.o binutils/objcopy: --compress-debug-sections=zstd: binutils is not built with zstd support % binutils/objcopy b.o --decompress-debug-sections binutils/objcopy: zstd.o: section .debug_abbrev is compressed with zstd, but BFD is not built with zstd support ... ```
2022-09-12ppc: Document the -mfuture and -Mfuture options and make them usablePeter Bergner1-1/+1
The -mfuture and -Mfuture options which are used for adding potential new ISA instructions were not documented. They also lacked a bitmask so new instructions could not be enabled by those options. Fixed. binutils/ * doc/binutils.texi: Document -Mfuture. gas/ * config/tc-ppc.c: Document -mfuture * doc/c-ppc.texi: Likewise. include/ * opcode/ppc.h (PPC_OPCODE_FUTURE): Define. opcodes/ * ppc-dis.c (ppc_opts) <future>: Use it. * ppc-opc.c (FUTURE): Define.
2022-08-23Add an option to dlltool to allow the creation of deterministic libraries.Nick Clifton1-0/+9
PR 29489 * dlltool.c (deterministic): New variable. (gen_lib_file): If deterministic is true set the BFD_DETERMINISTIC_OUTPUT flag. (usage): Mention --deterministic-libraries and --non-deterministic-libraries. (long_options): Add new options. (main): Parse new options. * doc/binutils.texi: Document the new options. * NEWS: Mention the new feature.
2022-08-09Default to enabling colored disassembly if output is to a terminal.Nick Clifton1-0/+3
PR 29457 * objdump.c (disassembler_color): Change type to an enum. (disassembler_extended_color): Remove. (usage): Update. (objdump_color_for_assembler_style): Update. (main): Update initialisation of disassembler_color. If not initialised via a command line option, set based upon terminal output. * doc/binutils.texi: Update description of disassmbler-color option. * testsuite/binutils-all/arc/objdump.exp: Add --disassembler-color=off option when disassembling. * testsuite/binutils-all/arm/objdump.exp: Likewise.
2022-05-18Add a --no-weak option to nm.Nick Clifton1-0/+5
PR 29135 * nm.c (non_weak): New variable. (filter_symbols): When non-weak is true, ignore weak symbols. (long_options): Add --no-weak. (usage): Mention --no-weak. (main): Handle -W/--no-weak. * doc/binutils.texi: Document new feature. * NEWS: Mention the new feature. * testsuite/binutils-all/nm.exp: Add test of new feature. * testsuite/binutils-all/no-weak.s: New test source file.
2022-05-11nm: use -U as an alias for --defines-only, in line with llvm-nmNick Clifton1-21/+26
2022-04-04objdump/opcodes: add syntax highlighting to disassembler outputAndrew Burgess1-0/+11
This commit adds the _option_ of having disassembler output syntax highlighted in objdump. This option is _off_ by default. The new command line options are: --disassembler-color=off # The default. --disassembler-color=color --disassembler-color=extended-color I have implemented two colour modes, using the same option names as we use of --visualize-jumps, a basic 8-color mode ("color"), and an extended 8bit color mode ("extended-color"). The syntax highlighting requires that each targets disassembler be updated; each time the disassembler produces some output we now pass through an additional parameter indicating what style should be applied to the text. As updating all target disassemblers is a large task, the old API is maintained. And so, a user of the disassembler (i.e. objdump, gdb) must provide two functions, the current non-styled print function, and a new, styled print function. I don't currently have a plan for converting every single target disassembler, my hope is that interested folk will update the disassemblers they are interested in. But it is possible some might never get updated. In this initial series I intend to convert the RISC-V disassembler completely, and also do a partial conversion of the x86 disassembler. Hopefully having the x86 disassembler at least partial converted will allow more people to try this out easily and provide feedback. In this commit I have focused on objdump. The changes to GDB at this point are the bare minimum required to get things compiling, GDB makes no use of the styling information to provide any colors, that will come later, if this commit is accepted. This first commit in the series doesn't convert any target disassemblers at all (the next two commits will update some targets), so after this commit, the only color you will see in the disassembler output, is that produced from objdump itself, e.g. from objdump_print_addr_with_sym, where we print an address and a symbol name, these are now printed with styling information, and so will have colors applied (if the option is on). Finally, my ability to pick "good" colors is ... well, terrible. I'm in no way committed to the colors I've picked here, so I encourage people to suggest new colors, or wait for this commit to land, and then patch the choice of colors. I do have an idea about using possibly an environment variable to allow the objdump colors to be customised, but I haven't done anything like that in this commit, the color choices are just fixed in the code for now. binutils/ChangeLog: * NEWS: Mention new feature. * doc/binutils.texi (objdump): Describe --disassembler-color option. * objdump.c (disassembler_color): New global. (disassembler_extended_color): Likewise. (disassembler_in_comment): Likewise. (usage): Mention --disassembler-color option. (long_options): Add --disassembler-color option. (objdump_print_value): Use fprintf_styled_func instead of fprintf_func. (objdump_print_symname): Likewise. (objdump_print_addr_with_sym): Likewise. (objdump_color_for_disassembler_style): New function. (objdump_styled_sprintf): New function. (fprintf_styled): New function. (disassemble_jumps): Use disassemble_set_printf, and reset disassembler_in_comment. (null_styled_print): New function. (disassemble_bytes): Use disassemble_set_printf, and reset disassembler_in_comment. (disassemble_data): Update init_disassemble_info call. (main): Handle --disassembler-color option. include/ChangeLog: * dis-asm.h (enum disassembler_style): New enum. (struct disassemble_info): Add fprintf_styled_func field, and created_styled_output field. (disassemble_set_printf): Declare. (init_disassemble_info): Add additional parameter. (INIT_DISASSEMBLE_INFO): Add additional parameter. opcodes/ChangeLog: * dis-init.c (init_disassemble_info): Take extra parameter, initialize the new fprintf_styled_func and created_styled_output fields. * disassembler.c (disassemble_set_printf): New function definition.
2022-03-10Add option to objdump/readelf to disable access to debuginfod servers.Nick Clifton2-1/+27
* dwarf.c (use_debuginfod): New variable. Set to 1. (load_separate_debug_info): Only call debuginfod_fetch_separate_debug_info is use_debuginfod is true. (dwarf_select_sections_by_names): Add do-not-use-debuginfod and use-debuginfod options. (dwarf_select_sections_by_letters): Add D and E options. * dwarf.h (use_debuginfod): New extern. * objdump.c (usage): Mention the new options. * readelf.c (usage): Likewise. * doc/binutils.texi: Document the new options. * doc/debug-options.texi: Describe the new options. * NEWS: Mention the new feature. * testsuite/binutils-all/debuginfod.exp: Add tests of the new options.
2022-02-03Support symbol+offset lookup in addr2lineAndi Kleen1-7/+11
The Linux kernel usually ouputs symbol+offset instead of plain code addresses these days, to avoid leaking ASLR secrets and to handle dynamically loaded modules. Converting those with addr2line is somewhat involved: it requires looking up the symbol first using nm and then manually compute the offset, and then pass it to addr2line. This patch implements the necessary steps directly in addr2line, by looking up the symbol (with demangling if needed) and computing the offset. It's possible that a symbol is ambigious with a hex number. In this case it uses the symbol lookup if the string contains a +. When it isn't ambigious the + is optional.
2022-01-11ar: Add --thin for creating thin archivesFangrui Song1-5/+10
In many ar implementations (FreeBSD, elfutils, etc), -T has the X/Open System Interface specified semantics. Therefore -T for thin archives is not recommended for portability. -T is deprecated without diagnostics. PR binutils/28759 * ar.c (long_options): Add --thin. (usage) Add --thin. Deprecate -T without diagnostics. * doc/binutils.texi: Add doc. * NEWS: Mention --thin. * binutils/testsuite/binutils-all/ar.exp: Add tests.
2022-01-05doc: Replace =frame-interp with =frames-interpH.J. Lu1-1/+1
The actual objdump and readelf option name is =frames-interp, not =frames-interp. PR binutils/28747 * doc/debug.options.texi: Replace =frame-interp with =frames-interp.
2022-01-02Update year range in copyright notice of binutils filesAlan Modra2-2/+2
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-12-21Typo fixes in binutils docAlan Modra1-4/+4
* doc/binutils.texi: Fix typos.
2021-12-01binutils: add missing prefix for binutils/index.html ruleMike Frysinger1-1/+1
2021-11-30Fix missing build dependency for binutils man pagesRoland McGrath1-16/+16
binutils/ * doc/local.mk: Give each man page target its missing dependency on doc/$(am__dirstamp).
2021-11-29binutils: merge doc subdir up a levelMike Frysinger2-1097/+50
This avoids a recursive make into the doc subdir and speeds up the build slightly. It also allows for more parallelism.
2021-11-29binutils: enable silent build rulesMike Frysinger2-124/+124
Also add $(AM_V_xxx) to various manual rules in here.
2021-11-29Update description of string's -n option.Nick Clifton1-2/+7
PR 28632 * strings.c (usage): Update desciption of -n option. * doc/binutils.texi: Likewise.
2021-11-17elfedit: Add --output-abiversion option to update ABIVERSIONH.J. Lu1-0/+12
* NEWS: Mention --output-abiversion. * elfedit.c (input_elf_abiversion): New. (output_elf_abiversion): Likewise. (update_elf_header): Update EI_ABIVERSION. (command_line_switch): Add OPTION_INPUT_ABIVERSION and OPTION_OUTPUT_ABIVERSION. (options): Add --input-abiversion and --output-abiversion. (usage): Likewise. (main): Handle --input-abiversion and --output-abiversion. * doc/binutils.texi: Document --input-abiversion and --output-abiversion. * testsuite/binutils-all/elfedit.exp: Run elfedit-6. * testsuite/binutils-all/elfedit-6.d: New file.
2021-11-09Add --unicode option to control how unicode characters are handled by ↵Nick Clifton1-0/+78
display tools. * nm.c: Add --unicode option to control how unicode characters are handled. * objdump.c: Likewise. * readelf.c: Likewise. * strings.c: Likewise. * binutils.texi: Document the new feature. * NEWS: Document the new feature. * testsuite/binutils-all/unicode.exp: New file. * testsuite/binutils-all/nm.hex.unicode * testsuite/binutils-all/strings.escape.unicode * testsuite/binutils-all/objdump.highlight.unicode * testsuite/binutils-all/readelf.invalid.unicode
2021-10-25binutils, ld: make objdump --ctf's parameter optionalNick Alcock1-1/+3
ld by default (and always, unless adjusted with a hand-rolled linker script) emits deduplicated CTF into the .ctf section. But viewing it needs you to explicitly tell objdump this: it doesn't default its argument, even though what you always end up typing is --ctf=.ctf. This is annoying, so make the argument optional. binutils/ChangeLog 2021-10-25 Nick Alcock <nick.alcock@oracle.com> * objdump.c (usage): --ctf now has an optional argument. (main): Adjust accordingly. (dump_ctf): Default it. * doc/ctf.options.texi: Adjust. ld/ChangeLog 2021-10-25 Nick Alcock <nick.alcock@oracle.com> * testsuite/ld-ctf/array.d: Change --ctf=.ctf to --ctf. * testsuite/ld-ctf/conflicting-cycle-1.B-1.d: Likewise. * testsuite/ld-ctf/conflicting-cycle-1.B-2.d: Likewise. * testsuite/ld-ctf/conflicting-cycle-1.parent.d: Likewise. * testsuite/ld-ctf/conflicting-cycle-2.A-1.d: Likewise. * testsuite/ld-ctf/conflicting-cycle-2.A-2.d: Likewise. * testsuite/ld-ctf/conflicting-cycle-2.parent.d: Likewise. * testsuite/ld-ctf/conflicting-cycle-3.C-1.d: Likewise. * testsuite/ld-ctf/conflicting-cycle-3.C-2.d: Likewise. * testsuite/ld-ctf/conflicting-cycle-3.parent.d: Likewise. * testsuite/ld-ctf/conflicting-enums.d: Likewise. * testsuite/ld-ctf/conflicting-typedefs.d: Likewise. * testsuite/ld-ctf/cross-tu-cyclic-conflicting.d: Likewise. * testsuite/ld-ctf/cross-tu-cyclic-nonconflicting.d: Likewise. * testsuite/ld-ctf/cross-tu-into-cycle.d: Likewise. * testsuite/ld-ctf/cross-tu-noncyclic.d: Likewise. * testsuite/ld-ctf/cycle-1.d: Likewise. * testsuite/ld-ctf/cycle-2.A.d: Likewise. * testsuite/ld-ctf/cycle-2.B.d: Likewise. * testsuite/ld-ctf/cycle-2.C.d: Likewise. * testsuite/ld-ctf/data-func-conflicted.d: Likewise. * testsuite/ld-ctf/diag-cttname-null.d: Likewise. * testsuite/ld-ctf/diag-cuname.d: Likewise. * testsuite/ld-ctf/diag-parlabel.d: Likewise. * testsuite/ld-ctf/enum-forward.d: Likewise. * testsuite/ld-ctf/enums.d: Likewise. * testsuite/ld-ctf/forward.d: Likewise. * testsuite/ld-ctf/function.d: Likewise. * testsuite/ld-ctf/nonrepresentable.d: Likewise. * testsuite/ld-ctf/slice.d: Likewise. * testsuite/ld-ctf/super-sub-cycles.d: Likewise.
2021-10-25binutils: make objdump/readelf --ctf-parent actually usefulNick Alcock1-4/+11
This option has been present since the very early days of the development of libctf as part of binutils, and it shows. Back in the earliest days, I thought we might handle ambiguous types by introducing new ELF sections on the fly named things like .ctf.foo.c for ambiguous types found only in foo.c, etc. This turned out to be a terrible idea, so we moved to using a CTF archive in the .ctf section which contained all the CTF dictionaries -- but the --ctf-parent option in objdump and readelf was never adjusted, and lingered as a mechanism to specify CTF parent dictionaries in sections other than .ctf, even though the linker has no way to produce parent dictionaries in different sections from their children, libctf's ctf_open can't handle such split-up parent/child dicts, and they are never found in the wild, emitted by GNU ld or by any known third-party linking tool. Meanwhile, the actually-useful ctf_link feature (albeit not used by ld) which lets you remap the names of CTF archive members (so you can end up with a parent archive member named something other than ".ctf", still contained with all its children in a single .ctf section) had no support in objdump or readelf: there was no way to tell them that these members were parents, so all the types in the associated child dicts always appeared corrupted, referencing nonexistent types from a parent objdump couldn't find. So adjust --ctf-parent so that rather than taking a section name it takes a member name instead (if not specified, the name is ".ctf", which is what GNU ld emits). Because the option was always useless before now, this is expected to have no backward-compatibility implications. As part of this, we have to slightly adjust the code which skips the archive member name if redundant: right now it skips it if it's ".ctf", on the assumption that this name will almost always be at the start of the objdump output and thus we'll end up with a shared dump and then smaller, headed dumps for the per-TU child dicts; but if the parent name has been changed, that won't be true any more. So change the rules to "members named .ctf which appear first in the first have their member name skipped". Since we now need to count members, move from ctf_archive_iter (for which passing in extra parameters requires defining a new struct and is clumsy) to ctf_archive_next, allowing us to just *call* dump_ctf_archive_member and maintain a member count in the obvious way. In the process we fix a tiny difference between readelf and objdump: if a ctf_dump ever failed, readelf skipped every later member, while objdump tried to keep going as much as it could. For a dumping tool the former is clearly preferable. binutils/ChangeLog 2021-10-25 Nick Alcock <nick.alcock@oracle.com> * objdump.c (usage): --ctf-parent now takes a name, not a section. (dump_ctf): Don't open a separate section; use the parent_name in ctf_dict_open instead. Use ctf_archive_next, not ctf_archive_iter, so we can pass down a member count. (dump_ctf_archive_member): Add the member count; don't return anything. Import parents into children no matter what the parent's name, while still avoiding displaying the header for the common parent name of ".ctf". * readelf.c (usage): Adjust similarly. (dump_section_as_ctf): Likewise. (dump_ctf_archive_member): Likewise. Never stop iterating over archive members, even if ctf_dump of one member fails. * doc/ctf.options.texi: Adjust.
2021-05-10Restore old behaviour of windres so that options containing spaces are not ↵Thomas Wolff1-4/+3
enclosed in double quotes. PR 4356 PR 26865 PR 27594 * windres.c (quot): Revert previous delta. Do not use double quotes when spaces are detected in options. * doc/binutils.texi (windres): Remove suggestion that the --preprocessor option can take arguments.
2021-05-08support generating multi-html pages in parallelMike Frysinger2-2/+12
Use the pattern from other projects where we generate the html pages in a dir named the same as the project. So now we have: gas/doc/gas.html - single html page gas/doc/gas/ - multiple html pages This works for projects that have a doc/ subdir already, but gprof & ld require a little tweaking since they generate their docs in their respective toplevels.
2021-05-08generate single html manual page by defaultMike Frysinger2-2/+4
This better matches other GNU projects like autoconf/automake where the html manual is the single page form. We'll support the multi-page form in a follow up change.
2021-04-29Correct the text describing windres's --processor option.Nick Clifton1-1/+6
PR 27594 * doc/binutils.texi (windres): Correct the description of the default value of the --preprocessor argument.
2021-04-21Add ability to select numeric base when displaying symbol values in readelf.Nick Lott1-0/+13
PR 27672 * readelf.c (sym_base): New variable. (enum print_mode): Add more modes. (print_vma): Add suport for new modes. (options): Add sym-base. (usage): Add sym-base. (parse_args): Add support for --sym-base. (print_dynamic_symbol_size): New function. (print_dynamic_symbol): Use new function. * doc/binutils.texi: Document the new feature. * NEWS: Mention the new feature.
2021-04-05C99 binutils configuryAlan Modra1-2/+1
* 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-15Add a symbols-only mode to nm.Nick Clifton1-14/+31
PR 27487 * nm.c (FORMAT_JUST_SYMBOLS): Define. (struct optput_fns): Add entry for FORMAT_JUST_SYMBOLS. (long_options): Add just-symbols. (set_output_format): Add support for just-symbols. (get_print_format): Likewise. (do_not_print_object_filename): New function. (do_not_print_archive_filename): New function. (do_not_print_archive_member): New function. (do_not_print_symbol_filename): New function. (just_print_symbol_name): New function. (main): Handle --just-symbols. * NEWS: Mention the new feature. * doc/binutils.texi: Document the new feature.
2021-03-04Gate the displaying of non-debug sections in separate debuginfo files.Nick Clifton1-1/+29
PR 27478 * objdump.c (process_links): New variable. (usage): Add --process-links. (long_options): Likewise. (dump_bfd): Stop processing once the bfd has been loaded unless this is the main file or process_links has been enabled. (main): Handle the process-links option. * readelf.c (process_links): New variable. (struct filedata): Add is_separate field. (options): Add --process-links. (usage): Likewise. (parse_args): Likewise. (process_file_header): Include the filename when dumping information for separate debuginfo files. (process_program_headers): Likewise. (process_section_headers): Likewise. (process_section_groups): Likewise. (process_relocs): Likewise. (process_dynamic_section): Likewise. (process_version_sections): Likewise. (display_lto_symtab): Likewise. (process_symbol_table): Likewise. (process_syminfo): Likewise. (initialise_dumps_by_name): Likewise. (process_section_contents): Likewise. (process_notes_at): Likewise. (process_notes): Likewise. (open_file): Add is_separate parameter. Use to initialise the is_separate field in the filedata structure. (open_deug): Update call to open_file. (process_object): Add processing of the contents of separate debuginfo files, gated by the process_links variable. (process_archive): Update call to open_file. (process_file): Initialise the is_separate field in the filedata structure. * dwarf.c (load_separate_debug_info_file): Only report the loading of a separate file if debug links are being dumped. * objcopy.c (keep_section_symbols): New variable. (enum command_line_switch): Add OPTION_KEEP_SYMBOLS. (strip_options): Add keep-section-symbols. (copy_options): Likewise. (copy_usage): Likewise. (strip_usage): Likewise. (copy_object): Keep section symbols if requested by command line option. (strip_main): Handle --keep-section-symbols. (copy_main): Likewise. * doc/binutils.texi: Document the new options. * NEWS: Mention the new features. * testsuite/binutils-all/compress.exp (test_gnu_debuglink): Update options passed to objdump. Use diff rather than cmp to compare the dumped data. * testsuite/binutils-all/objdump.WK2: Update regexp. * testsuite/binutils-all/objdump.WK3: Update regexp. * testsuite/binutils-all/objdump.exp: Use --process-links instead of --dwarf=follow-links. * testsuite/binutils-all/readelf.exp (readelf_test): Include readelf's output in the log when the test fails. Add the -P option to the -wKis test. * testsuite/binutils-all/readelf.wKis: Update expected output.
2021-03-01PR27128, nm -P portable output format regressionAlan Modra1-1/+12
Add nm --without-symbol-versions. binutils/ PR 27128 * doc/binutils.texi: Add nm --with-symbol-versions and --without-symbol-versions documentation. * nm.c (with_symbol_versions): New variable. (enum long_option_values): Delete OPTION_WITH_SYMBOL_VERSIONS. (long_options): Make --with-symbol-versions entry twiddle the flag. Add --without-symbol-versions. (print_symname): Strip version when !with_symbol_versions. Add dynamic version info under control of with_symbol_versions. (main): Remove OPTION_WITH_SYMBOL_VERSIONS case. ld/ * testsuite/ld-elf/pr25708.d: Add --with-symbol-versions to nm. * testsuite/ld-elf/pr27128a.d: Likewise. * testsuite/ld-elf/pr27128b.d: Likewise. * testsuite/ld-elf/pr27128c.d: Likewise. * testsuite/ld-elf/pr27128d.d: Likewise. * testsuite/ld-elf/pr27128e.d: Likewise.
2021-02-26nm: Add --quiet to suppress "no symbols" diagnosticFangrui Song1-0/+5
PR binutils/27408 * readelf.c (quiet): New option flag. (enum long_option_values): New enum to hold long option value. (long_options): Add --quiet. (usage): Mention --quiet. (display_rel_file): If quiet is enabled, suppress "no symbols". (main): Handle the new option. * NEWS: Mention --quiet. * docs/binutils.texi: Document --quiet.
2021-02-25Add initial support for .debug_sup sections.Nick Clifton1-5/+5
* dwarf.c (get_type_abbrev_from_form): Accept but ignore sup forms. (read_and_display_attr_value): Handle sup forms. (display_debug_sup): New function. Displays the contents of a .debug_sup section. (load_debug_sup_file): New function. Loads the contents of a file referenced by a .debug_sup section. (check_for_and_load_links): Call load_debug_sup_file. (debug_displays): Add entry for .debug_sup. * dwarf.h (enum dwarf_section_display_enum): Add debug_sup. * readelf.c (process_section_headers): Add support for debug_sup. * doc/debug.options.texi: Note that the =links option will display the contents of .debug_sup sections. * NEWS: Mention the new support.
2021-02-14Regen for binutils/aclocal.m4 changeAlan Modra1-1/+2
* Makefile.in: Regenerate. * doc/Makefile.in: Regenerate.
2021-02-12Change the readelf and objdump programs so that they will automatically ↵Nick Clifton2-6/+21
follow links to separate debug info files. * configure.ac (follow-debug-links): Add option to enable or disable the following of debug links by default. Set the default for the option to be 'follow'. * dwarf.c (do_follow_links): Initialise with DEFAULT_FOR_FOLLOW_LINKS. (dwarf_select_sections_by_names): Add no-follow-links option. (dwarf_select_sections_by_letter): Add 'N' option. * objdump.c (usage): Add conditional text describing the follow links option. (slurp_symtab): Ensure that there is a NULL entry at the end of the symbol table. (slurp_dynamic_symtab): Likewise. (dump_bfd): When extending the symbol table, ensure that there is still a NULL entry at the end. * readelf.c (usage): Add conditional text describing the follow links option. * doc/binutils.texi: Update documentation for objcopy and readelf. * doc/debug.options.texi: Update documentation of the follow-links option. * config.in: Regenerate. * configure: Regenerate. * testsuite/binutils-all/compress.exp: Add the -WN option to objdump command lines that are not expecting to follow links. * testsuite/binutils-all/readelf.exp: Add the --debug-dump=no-follow-links option to tests that are not expecting to follow debug links. gas * testsuite/gas/mach-o/sections-1.d: Stop automatic debug link following. * testsuite/gas/xgate/insns-dwarf2.d: Likewise. ld * testsuite/ld-elf/sec64k.exp: Stop readelf from automatically following debug links.
2021-01-13Regen Makefile.in for jobserver.m4 aclocal.m4 dependencyAlan Modra1-0/+1
bfd/ * Makefile.in: Regenerate. * doc/Makefile.in: Regenerate. binutils/ * Makefile.in: Regenerate. * doc/Makefile.in: Regenerate. gas/ * Makefile.in: Regenerate. * Makefile.in: Regenerate. gprof/ * Makefile.in: Regenerate. ld/ * Makefile.in: Regenerate. libctf/ * Makefile.in: Regenerate. opcodes/ * Makefile.in: Regenerate.
2021-01-01PR27116, Spelling errors found by Debian style checkerAlan Modra1-1/+1
PR 27116 bfd/ * xcofflink.c: Correct spelling in comments. binutils/ * coffgrok.c (do_type): Correct spelling of auxiliary in errors. * doc/binutils.texi: Correct grammar. * readelf.c (process_version_sections): Correct spelling of auxiliary in warning. * testsuite/binutils-all/vax/objdump.exp: Comment grammar fix. config/ * override.m4: Correct comment grammar. gas/ * config/tc-i386.c: Correct comment spelling. * config/tc-riscv.c: Likewise. * config/tc-s390.c: Correct comment grammar. * doc/c-i386.texi: Correct spelling. * doc/c-s390.texi: Correct grammar. gold/ * tilegx.cc: Correct comment spelling. gprof/ * README: Correct grammar. * gprof.texi: Likewise. include/ * coff/internal.h: Correct comment spelling. * coff/sym.h: Likewise. * opcode/aarch64.h: Likewise. ld/ * configure.tgt: Correct comment grammar. * emultempl/m68hc1xelf.em: Likewise. * ld.texi: Correct grammar.
2021-01-01Update year range in copyright notice of binutils filesAlan Modra3-3/+3
2020-12-23x86-64: Add Intel LAM property supportH.J. Lu1-1/+2
Add Intel Linear Address Masking (LAM) property support. LAM modifies the checking that is applied to 64-bit linear addresses, allowing software to use of the untranslated address bits for metadata. bfd/ * elf-linker-x86.h (elf_x86_cet_report): Renamed to ... (elf_x86_prop_report): This. (elf_linker_x86_params): Add lam_u48, lam_u57, lam_u48_report and lam_u57_report. * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Support GNU_PROPERTY_X86_FEATURE_1_LAM_U48 and GNU_PROPERTY_X86_FEATURE_1_LAM_U57. (_bfd_x86_elf_link_fixup_gnu_properties): Keep LAM features only for 64-bit output. binutils/ * NEWS: Mention LAM_U48 and LAM_U57 support. * elfedit.c (elf_x86_feature): Support lam_u48 and lam_u57. (usage): Add lam_u48 and lam_u57. * readelf.c (decode_x86_feature_1): Support LAM_U48 and LAM_U57. * doc/binutils.texi: Update elfedit with lam_u48 and lam_u57 support. * testsuite/binutils-all/x86-64/lam-u48.d: New file. * testsuite/binutils-all/x86-64/lam-u48.s: Likewise. * testsuite/binutils-all/x86-64/lam-u57.d: Likewise. * testsuite/binutils-all/x86-64/lam-u57.s: Likewise. include/ * elf/common.h (GNU_PROPERTY_X86_FEATURE_1_LAM_U48): New. (GNU_PROPERTY_X86_FEATURE_1_LAM_U57): Likewise. ld/ * NEWS: Mention LAM_U48 and LAM_U57 support. * ld.texi: Document LAM_U48 and LAM_U57 support. * emulparams/cet.sh: Updated. * emulparams/elf_x86_64.sh: Source x86-64-lam.sh. * emulparams/x86-64-lam.sh: New file. * testsuite/ld-x86-64/property-x86-lam-u48-1a.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u48-1b.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u48-2.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u48-3a.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u48-3b.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u48-4.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u48-5.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u48.s: Likewise. * testsuite/ld-x86-64/property-x86-lam-u57-1a.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u57-1b.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u57-2.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u57-3a.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u57-3b.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u57-4.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u57-5.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u57.s: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run LAM tests.
2020-11-20Add option to nm to change the characters displayed for ifunc symbols. Add ↵Nick Clifton1-6/+25
a configure time option to change the default characters. PR 22967 * nm.c (ifunc_type_chars): New variable. (long_options): Add --ifunc-chars. (print_symbol): Use ifunc_type_chars for ifunc symbols. (main): Handle the new option. * doc/binutils.texi: Document the new option. * configure.ac: Add --enable-f-for-ifunc-symbols option which changes the default symbol displayed by nm. * NEWS: Mention the new feature. * testsuite/binutils-all/nm.exp: Test the new feature. * config.in: Regenerate. * configure: Regenerate.
2020-11-03Add an option to the archiver to add a section recording library dependencies.Howard Chu1-4/+15
* ar.c (long_options): Add --record-libdeps. (usage): Mention the new option. (decode_options): Handle the new option. (replace_members): If necessary, create a bfd to hold the libdeps description. * binemul.c (ar_emul_append_bfd): New function. (ar_emul_replace_bfd): New function. (ar_emul_default_append): Replace file_name and target arguments with new_bfd argument. (ar_emul_default_replace): Likewise. * binemul.h: Update prototypes. (struct bin_emulation_xfer_struct): Update fields. * doc/binutils.texi: Document the new option. * NEWS: Mention the new feature. * emul_aix.c (ar_emul_aix_append): Update. (ar_emul_aix_replace): Likewise. * testsuite/binutils-all/ar.exp: Add test of new feature.
2020-10-19Readelf: Add --lto-syms option to display LTO symbol tables.Nick Clifton1-1/+5
* readelf.c (do_lto_syms): New local. (long_option_values): Add OPTION_LTO_SYMS. (options): Add --lto-syms. (usage): Mention the new option. (parse_args): Parse the new option. (get_lto_kind): New function. (get_lto_visibility): New function. (get_lto_sym_type): New function. (display_lto_symtab): New function - displays the contents of an LTo symbol table section. (process_lto_symbol_tables): New functions. Calls dipslay_lto_symtab on any LTO symbol table section. (process_object_file): Call process_lto_symbol_tables. * doc/binutils.texi: Document the new option. * NEWS: Mention the new feature.
2020-10-05Fix spelling mistakesSamanta Navarro1-8/+8