aboutsummaryrefslogtreecommitdiff
path: root/bfd/doc
AgeCommit message (Collapse)AuthorFilesLines
2023-11-07Add minimal thread-safety to BFDTom Tromey1-0/+1
This patch provides some minimal thread-safety to BFD. The BFD client can request thread-safety by providing a lock and unlock function. The globals used during BFD creation (e.g., bfd_id_counter) are then locked, and the file descriptor cache is also locked. A function to clean up any thread-local data is now provided for BFD clients. * bfd-in2.h: Regenerate. * bfd.c (lock_fn, unlock_fn): New globals. (bfd_thread_init, bfd_thread_cleanup, bfd_lock, bfd_unlock): New functions. * cache.c (bfd_cache_lookup_worker): Use _bfd_open_file_unlocked. (cache_btell, cache_bseek, cache_bread, cache_bwrite): Lock and unlock. (cache_bclose): Add comment. (cache_bflush, cache_bstat, cache_bmmap): Lock and unlock. (_bfd_cache_init_unlocked): New function. (bfd_cache_init): Use it. Lock and unlock. (_bfd_cache_close_unlocked): New function. (bfd_cache_close, bfd_cache_close_all): Use it. Lock and unlock. (_bfd_open_file_unlocked): New function. (bfd_open_file): Use it. Lock and unlock. * doc/bfd.texi (BFD front end): Add Threading menu item. * libbfd.h: Regenerate. * opncls.c (_bfd_new_bfd): Lock and unlock. * po/bfd.pot: Regenerate.
2023-10-23bfd-in2.h BFD_RELOC_* commentsAlan Modra2-24/+52
I noticed the regenerated BFD_RELOC_MICROBLAZE_32_NONE comment didn't match that committed to bfd-in2.h, and was just going to regen bfd-in2.h but then decided to do something about the silly formatting of these comments in bfd-in2.h. eg. the BFD_RELOC_MICROBLAZE_32_NONE comment: -/* This is a 32 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction).No relocation is -done here - only used for relaxing */ + /* This is a 32 bit reloc that stores the 32 bit pc relative value in + two words (with an imm instruction). No relocation is done here - + only used for relaxing. */ BFD_RELOC_MICROBLAZE_32_NONE, You'll notice how the second and third line of the original comment aren't indented properly relative to the first line, and the whole comment needs to be indented to match the code. I've also edited reloc.c ENUMDOC paragraphs. Some of these had excess indentation, presumably in an attempt to properly indent bfd-in2.h comments but that fails due to chew.c removing leading whitespace early by skip_white_and_stars. COMMENT was used in reloc.c to add extra blank lines in bfd-in2.h. I've removed them too as I don't think they add anything to readability of that file. (Perhaps more usefully, they also add blank lines to libbfd.h separating relocs for one target from others, but this isn't done consistently.) * doc/chew.c (drop, idrop): Move earlier. (strip_trailing_newlines): Check index before accessing array, not after. (wrap_comment): New function. (main): Add "wrap_comment" intrinsic. * doc/proto.str (ENUMDOC): Use wrap_comment. (make_enum_header, ENDSENUM): Put start and end braces on separate lines. * reloc.c: Remove uses of COMMENT and edit ENUMDOC paragraphs. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate.
2023-09-01PR30806, CPPFLAGS are missing for bfd/chew, syslex_wrap and sysinfoNicolas Boulenguez1-1/+1
PR 30806 bfd/ * doc/local.mk (doc/chew.stamp): Add CPPFLAGS_FOR_BUILD. * Makefile.in: Regenerate. binutils/ * Makefile.am (syslex_wrap.@OBJEXT@): Add CPPFLAGS_FOR_BUILD. (sysinfo.@OBJEXT@): Likewise. * Makefile.in: Regenerate.
2023-08-31Revert "Simplify @node use in BFD documentation"Tom Tromey2-29/+29
This reverts commit 8bb23cdbb498ff645bb0937bc8c0cb89e9e5ebd8. My earlier patch to simplifify the @node uses in the BFD manual didn't take into account (1) that BFD doesn't use the ordinary texinfo sectioning commands, and (2) that some users are stuck on very ancient versions of makeinfo. This patch reverts the change. I went through the entire manual using the spacebar, trying to find the original problem I reported in the change, but couldn't. I don't know why. Anyway, all this means is that, with this reversion, editing the node structure will be slightly less convenient. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30703 2023-08-30 Tom Tromey <tom@tromey.com> PR binutils/30703 * doc/webassembly.texi, doc/bfd.texi: Revert 8bb23cdb, adding parameters back to @node.
2023-08-31libbfd.texi zero sizeAlan Modra1-2/+2
Pattern rules in doc/local.mk exist that specify how to make libbfd.texi from libfd.h or libbfd.c. Since both files exist and the libbfd.h rule is first, libbfd.h is used. libbfd.h doesn't contain the documentation.. * doc/local.mk (doc/%stamp): Put rule making this from %.c before %.h rule. * Makefile.in: Regenerate. * libbfd.c (Byte swapping routines): Don't omit description.
2023-08-09Rename bfd_bread and bfd_bwriteAlan Modra1-2/+2
These were renamed from bfd_read and bfd_write back in 2001 when they lost an unnecessary parameter. Rename them back, and get rid of a few casts that are only needed without prototyped functions (K&R C).
2023-06-07_bfd_free_cached_infoAlan Modra1-14/+17
doc/bfdint.texi and comments in the aout and som code about this function are just wrong, and its name is not very apt. Better would be _bfd_mostly_destroy, and we certainly should not be saying anything about the possibility of later recreating anything lost by this function. What's more, if _bfd_free_cached_info is called when creating an archive map to reduce memory usage by throwing away symbols, the target _close_and_cleanup function won't have access to tdata or section bfd_user_data to tidy memory. This means most of the target _close_and_cleanup function won't do anything, and therefore sometimes will result in memory leaks. This patch fixes the documentation problems and moves most of the target _close_and_cleanup code to target _bfd_free_cached_info. Another notable change is that bfd_generic_bfd_free_cached_info is now defined as _bfd_free_cached_info rather than _bfd_bool_bfd_true, ie. the default now frees objalloc memory.
2023-05-03Generated docs and include filesAlan Modra3-34/+85
bfd/doc/chew.c extracts documentation from source code comments annotated with keywords, and generates much of bfd.h and libbfd.h from those same comments. The docs have suffered from people (me too) adding things like CODE_FRAGMENT to the source to put code into bfd.h without realising that CODE_FRAGMENT also puts @example around said code into the docs. So we have random senseless things in the docs. This patch fixes that problem (well, the senseless things from CODE_FRAGMENT), moves most of the code out of bfd-in.h, and improves a few chew.c features. libbfd.h now automatically gets ATTRIBUTE_HIDDEN prototypes, and indentation in bfd.h and libbfd.h is better.
2023-02-28chew.c printf of intptr_tAlan Modra1-1/+2
Seen when building binutils with gcc -m32 on x86_64-linux. chew.c: In function ‘print’: chew.c:1434:59: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘intptr_t’ {aka ‘int’} [-Wformat=] 1434 | fprintf (stderr, "print: illegal print destination `%ld'\n", *isp); | ~~^ ~~~~ | | | | | intptr_t {aka int} | long int | %d * chew.c: Include inttypes.h. (print): Use PRIdPTR for *isp.
2023-02-20Redefine FUNCTION in doc.strTom Tromey1-9/+1
FUNCTION is identical to func, so simplify doc.str. 2023-02-17 Tom Tromey <tom@tromey.com> * doc/doc.str (FUNCTION): Call func.
2023-02-20Fix formatting of long function description in chew outputTom Tromey2-0/+35
Currently, if a function description spans a line, the resulting info can look like this: -- Function: long bfd_canonicalize_reloc (bfd *abfd, asection *sec, arelent **loc, asymbol **syms); Call the back end associated with the open BFD ABFD and translate the external form of the relocation information attached to SEC into the internal canonical form. Place the table into memory at LOC, That is, the function prototype runs together with the text in an ugly way. This patch fixes this by introducing a new primitive, so that the generated Texinfo can be a bit nicer. Now this output looks like: -- Function: long bfd_canonicalize_reloc (bfd *abfd, asection *sec, arelent **loc, asymbol **syms); Call the back end associated with the open BFD ABFD and translate the external form of the relocation information attached to SEC 2023-02-17 Tom Tromey <tom@tromey.com> * doc/doc.str (SYNOPSIS): Use collapse_whitespace. * doc/chew.c (collapse_whitespace): New function. (main): Register collapse_whitespace.
2023-02-19Avoid memory leak in chewTom Tromey1-3/+9
An earlier patch of mine introduced a memory leak in chew. The bug was that the new "variable" word didn't free the following word. This patch fixes it by arranging to transfer ownership of the name to the variable itself. * doc/chew.c (add_variable): New function, from add_intrinsic_variable. (add_intrinsic_variable): Call add_variable. (compile): Call add_variable.
2023-02-15Remove RETURNS from BFD chew commentsTom Tromey2-4/+0
When reading the BFD manual, I noticed text like this: -- Function: bool bfd_close (bfd *abfd); Close a BFD. If the BFD was open for writing, then pending operations are completed and the file written out and closed. If ... *Returns* 'TRUE' is returned if all is ok, otherwise 'FALSE'. The *Returns*, like the *Synopsis* in the earlier patch, is un-info-like. It's also used inconsistently. This patch removes all the uses of the RETURNS word and removes it entirely from the chew scripts. Now this example reads: -- Function: bool bfd_close (bfd *abfd); Close a BFD. If the BFD was open for writing, then pending operations are completed and the file written out and closed. If ... 'TRUE' is returned if all is ok, otherwise 'FALSE'. In a few cases I had to slightly reword the comment. There were also a couple of cases where there was redundant text. In these cases I just dropped the RETURNS copy. 2023-02-07 Tom Tromey <tom@tromey.com> * bfd.c, cache.c, compress.c, opncls.c: Remove RETURNS from documentation comments. * doc/doc.str, doc/proto.str (RETURNS): Remove.
2023-02-15Use @deftypefn in chew outputTom Tromey2-5/+39
When reading the BFD info manual, function definitions looked very strange to me: *Synopsis* long bfd_get_mtime (bfd *abfd); *Description* Return the file modification time (as read from the file system, or from the archive header for archive members). The *Synopsis* and *Description* text in particular is very un-info-like. To fix this, I tried removing the *Synopsis* text and having FUNCTION use @deftypefn instead. However, this ended up requiring some new state, because SYNOPSIS can appear without FUNCTION. This in turn required "catstrif" (I considered adding FORTH-style if-else-then, but in the end decided on an ad hoc approach). After this the result looks like: -- Function: long bfd_get_mtime (bfd *abfd); Return the file modification time (as read from the file system, or from the archive header for archive members). This patch also reorders a few documentation comments to ensure that SYNOPSIS comes before DESCRIPTION. This is the more common style and is also now required by doc.str. 2023-02-07 Tom Tromey <tom@tromey.com> * syms.c (bfd_decode_symclass, bfd_is_undefined_symclass) (bfd_symbol_info): Reorder documentation comment. * doc/doc.str (synopsis_seen): New variable. (SYNOPSIS): Set synopsis_seen. Emit @deftypefn. (DESCRIPTION): Use synopsis_seen. * doc/chew.c (catstrif): New function. (main): Add catstrif intrinsic. (compile): Recognize "variable" command.
2023-02-15Change internalmode to be an intrinsic variableTom Tromey2-19/+39
Currently, internalmode is a special word to set an internal state variable. Because this series adds variables anyway, change this to be a variable instead. I saw some commits in the history that made sure that chew did not leak memory, so I put some extra effort into trying to handle this for variables as well. 2023-02-07 Tom Tromey <tom@tromey.com> * doc/proto.str (external, internal, ifinternal, ENUMEQ, ENUMDOC): Update. * doc/chew.c (internalmode): Remove. (add_intrinsic_variable): New function. (main): Add internalmode as intrinsic. (internal_mode): Remove global. (maybecatstr): Update. (free_words): Free variables.
2023-02-15Use intptr_t rather than long in chewTom Tromey1-6/+7
To implement variables in chew, it's convenient to have a pointer-sized integer on the stack. To this end, use intptr_t rather than long. 2023-02-07 Tom Tromey <tom@tromey.com> * doc/chew.c (pcu) <l>: Now intptr_t. (internal_mode, istack, isp): Likewise. (bang, atsign): Use intptr_t.
2023-02-15Remove the paramstuff wordTom Tromey2-81/+0
The chew "paramstuff" word has been a no-op since: commit c58b95236ce4c9345c4fa76e7ef16762e5229380 Author: Alan Modra <amodra@gmail.com> Date: Sun Jun 29 10:06:40 2003 +0000 Convert to C90 and a few tweaks. Remove it and its one use. 2023-02-07 Tom Tromey <tom@tromey.com> * doc/proto.str (SYNOPSIS): Don't use paramstuff. * doc/chew.c (paramstuff): Remove. (main): Don't add paramstuff intrinsic.
2023-02-15Add copyright headers to the .str filesTom Tromey2-0/+35
The .str script files don't have copyright headers, but I think they should. I used the same dates that chew.c uses, which I think makes sense because these are inputs to chew. 2023-02-07 Tom Tromey <tom@tromey.com> * doc/doc.str, doc/proto.str: Add copyright header.
2023-02-15Simplify @node use in BFD documentationTom Tromey2-29/+29
The BFD docs currently specify all the parameters to @node. However, this results in bad navigation in certain nodes -- the "space" command in info doesn't know how to find the next node. I think this style of @node is a leftover from ancient times. Makeinfo can figure out the node structure on its own now, so simplify everything to a single-argument @node. 2023-02-07 Tom Tromey <tom@tromey.com> * doc/webassembly.texi (File layout): Remove second argument from @node. * doc/bfd.texi: Use single-argument @node everywhere.
2023-02-15Remove H_CFLAGS from doc/local.mkTom Tromey1-1/+1
I couldn't see that H_CFLAGS is defined anywhere, so remove it. 2023-02-07 Tom Tromey <tom@tromey.com> * Makefile.in: Rebuild. * doc/local.mk (%D%/chew.stamp): Don't use H_CFLAGS.
2023-01-10Re: Move bfd_init to bfd.cAlan Modra1-6/+3
Commit b1c95bc4dd73 resulted in ...bfd.texi:246: @include: could not find init.texi which went unnoticed due to not building in a clean directory. This fixes the problem by moving bfd_init earlier, giving it a doc node, and stitching the nodes back together. * bfd.c (bfd_init): Move earlier. Give it a doc inode. Adjust other inodes to suit. * doc/bfd.texi: Don't include init.texi. Adjust nodes to suit.
2023-01-10Move bfd_init to bfd.cAlan Modra1-4/+2
init.c contains just one function that doesn't do much. Move it to bfd.c and give it something to do, initialising static state. So far the only initialisation is for bfd.c static variables. The idea behind reinitialising state is to see whether some set of flaky oss-fuzz crashes go away. oss-fuzz stresses binutils in ways that can't occur in reality, feeding multiple testcases into the internals of binutils. So one testcase may affect the result of the next testcase. * init.c: Delete file. Move bfd_init to.. * bfd.c (bfd_init): ..here. Init static variables. * Makefile.am (BFD32_LIBS): Remove init.lo. (BFD32_LIBS_CFILES, BFD_H_FILES): Remove init.c. * doc/local.mk: Remove mention of init.texi and init.c. * Makefile.in: Regenerate. * bfd-in2.h: Regenerate. * po/SRC-POTFILES.in: Regenerate.
2023-01-02obsolete target tidyAlan Modra2-5/+1
Delete a few files only used for obsolete targets, and tidy config, xfails and other pieces of support specific to those targets. And since I was editing target triplets in test files, fix the nm alpha-linuxecoff fails.
2023-01-01Update year range in copyright notice of binutils filesAlan Modra6-9/+9
The newer update-copyright.py fixes file encoding too, removing cr/lf on binutils/bfdtest2.c and ld/testsuite/ld-cygwin/exe-export.exp, and embedded cr in binutils/testsuite/binutils-all/ar.exp string match.
2022-06-01Re: use libiberty xmalloc in bfd/doc/chew.cAlan Modra2-5/+40
We can't use libiberty.a in chew. libiberty is a host library, chew a build program. Partly revert commit 7273d78f3f7a, instead define local versions of the libiberty functions. ansidecl.h also isn't needed. * doc/chew.c: Don't include libiberty.h or ansidecl.h. (xmalloc, xrealloc, xstrdup): New functions. * doc/local.mk (LIBIBERTY): Don't define or use. * Makefile.in: Regenerate.
2022-05-30Use a union to avoid casts in bfd/doc/chew.cAlan Modra1-24/+41
This fixes -Wpedantic warnings in chew.c. Conversion between function and object pointers is not guaranteed. They can even be different sizes, not that we're likely to encounter build machines like that nowadays. PR 29194 * doc/chew.c (pcu): New union typedef. (dict_type, pc): Use it here. Adjust uses of pc. (add_to_definition): Make "word" param a pcu. Adjust all uses of function. (stinst_type): Delete.
2022-05-30use libiberty xmalloc in bfd/doc/chew.cAlan Modra2-11/+13
Catch out of memory. * doc/chew.c: Include libibery.h. (init_string_with_size, nextword): Replace malloc with xmalloc. (newentry, add_to_definition): Likewise. (catchar, catbuf): Replace realloc with xrealloc. (add_intrinsic): Replace strdup with xstrdup. * doc/local.mk (LIBIBERTY): Define. (chew): Link against libiberty. * Makefile.in: Regenerate.
2022-05-30Update K&R functions in bfd/doc/chew.cAlan Modra1-162/+62
* doc/chew.c: Update function definitions to ISO C, remove now unnecessary prototypes.
2022-05-30Reorganise bfd/doc/chew.c a littleAlan Modra1-64/+38
This also removes some unused variables, and deletes support for the "var" keyword which isn't used and was broken. (No means to set variables, and add_var used push_number inconsistent with its use elsewhere.) * doc/chew.c: Move typedefs before variables, variables before functions. (die): Move earlier. (word_type, sstack, ssp): Delete. (dict_type): Delete var field. (add_var): Delete. (compile): Remove "var" support.
2022-01-26bfd: Make bfd.stamp depend on source bfd.texiH.J. Lu1-2/+3
Make bfd.stamp depend on source bfd.texi to avoid regenerating doc/bfd.info for each make run. PR binutils/28807 * Makefile.in: Regenerate. * doc/local.mk (%D%/bfd.stamp): Depend on $(srcdir)/%D%/bfd.texi.
2022-01-24bfd: Update doc/local.mkH.J. Lu1-3/+4
PR binutils/28807 * Makefile.in: Regenerate. * doc/local.mk (AM_MAKEINFOFLAGS): Add -I "$(srcdir)/%D%" -I %D%. (TEXI2DVI): New. (%D%/bfd.texi): Removed. (doc/bfd/index.html): Remove -I$(srcdir). Replace bfd.texi with %D%/bfd.texi.
2022-01-24bfd/doc: Fix racy build failure from missing mkdirRoland McGrath1-0/+1
bfd/ * doc/local.mk (%D%/bfdver.texi): Add mkdir command.
2022-01-23bfd: Properly install library and header filesH.J. Lu1-4/+0
Rename bfdlib_LTLIBRARIES and bfdinclude_HEADERS to lib_LTLIBRARIES and include_HEADERS to fix the missing installed library and header files in bfd caused by commit bd32be01c997f686ab0b53f0640eaa0aeb61fbd3 Author: Mike Frysinger <vapier@gentoo.org> Date: Fri Dec 3 00:23:20 2021 -0500 bfd: merge doc subdir up a level PR binutils/28807 * Makefile.am (bfdlib_LTLIBRARIES): Renamed to ... (lib_LTLIBRARIES): This. (bfdinclude_HEADERS): Renamed to ... (include_HEADERS): This. * Makefile.in: Regenerate. * doc/local.mk (install): Removed.
2022-01-22bfd: merge doc subdir up a levelMike Frysinger3-1088/+156
This avoids a recursive make into the doc subdir and speeds up the build slightly. It also allows for more parallelism.
2022-01-22bfd: rename core.texi to corefile.texiMike Frysinger3-9/+3
This is a generated file name from a correspondingly named C file. Rename it to avoid unique build rules since there's no difference to the generated manual.
2022-01-22bfd: replace doc header generation with pattern rulesMike Frysinger2-156/+12
This unifies boilerplate rules for most files with pattern rules.
2022-01-17Update the config.guess and config.sub files from the master repository and ↵Nick Clifton1-0/+1
regenerate files.
2022-01-02Update year range in copyright notice of binutils filesAlan Modra7-10/+10
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.
2022-01-01unify 64-bit bfd checksMike Frysinger1-0/+1
Move the 64-bit bfd logic out of bfd/configure.ac and into bfd64.m4 under config so it can be shared between all the other subdirs. This replaces want64 with enable_64_bit_bfd which was already being declared, but not used directly.
2021-12-16bfd: unify texi generation rulesMike Frysinger2-184/+74
The logic between these rules are extremely similar, so unify them into a single variable by leveraging make $@ and $< variables. Also add automake silent rule support while we're here.
2021-12-03bfd: move header updates up a directoryMike Frysinger2-188/+0
The rules for rebuilding the bfd headers live in the doc/ subdir (most likely) because they rely on the chew & related tools. But we can collapse them into the main Makefile while keeping the tools in the doc subdir easily enough. This makes the code simpler and allows for rebuilding them in parallel. Also add automake silent rule support while we're here.
2021-12-01bfd: delete unused proto settingsMike Frysinger2-21/+0
These have been around for decades but don't appear to be used, and trying to build them (e.g. `make archive.p archive.ip`) doesn't work, so just delete it all.
2021-08-06chew ubsan warningAlan Modra1-2/+2
It matters not at all if pc is incremented from its initial NULL value, but avoid this silly runtime ubsan error. * doc/chew.c (perform): Avoid incrementing NULL pc.
2021-05-08support generating multi-html pages in parallelMike Frysinger2-7/+17
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-0/+3
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-03-31Remove bfd_stdint.hAlan Modra1-1/+0
If we require C99 for binutils then stdint.h is available. bfd/ * .gitignore: Delete bfd_stdint.h entry. * Makefile.am (bfdinclude_HEADERS): Delete bfd_stdint.h. (BUILD_HFILES, LOCAL_H_DEPS): Likewise. * bfd-in.h: Include stdint.h in place of bfd_stdint.h. * configure.ac: Don't invoke GCC_HEADER_STDINT. * configure.com: Don't create bfd_stdint.h. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * bfd-in2.h: Regenerate. * config.in: Regenerate. * configure: Regenerate. * doc/Makefile.in: Regenerate. * po/BLD-POTFILES.in: Regenerate. binutils/ * coffdump.c: Include stdint.h in place of bfd_stdint.h. * dwarf.c: Likewise. gas/ * config/tc-aarch64.c: Include stdint.h in place of bfd_stdint.h. * config/tc-crx.c: Likewise. * config/tc-nds32.h: Likewise. include/ * cgen/basic-modes.h: Include stdint.h in place of bfd_stdint.h. * elf/nfp.h: Likewise. * opcode/aarch64.h: Likewise. * opcode/cgen.h: Likewise. * opcode/nfp.h: Likewise. * opcode/ppc.h: Likewise. ld/ * elf-hints-local.h: Include stdint.h in place of bfd_stdint.h. * emultempl/nds32elf.em: Likewise. * testsuite/ld-elf/mbind2b.c: Likewise. * testsuite/ld-elf/pr18718.c: Likewise. * testsuite/ld-elf/pr18720a.c: Likewise. * testsuite/ld-elf/pr25749-1.c: Likewise. * testsuite/ld-elf/pr25749-1a.c: Likewise. * testsuite/ld-elf/pr25749-1b.c: Likewise. * testsuite/ld-elf/pr25749-1c.c: Likewise. * testsuite/ld-elf/pr25749-1d.c: Likewise. * testsuite/ld-elf/pr25749-2.c: Likewise. * testsuite/ld-elf/pr25754-1a.c: Likewise. * testsuite/ld-elf/pr25754-2a.c: Likewise. * testsuite/ld-elf/pr25754-3a.c: Likewise. * testsuite/ld-elf/pr25754-4a.c: Likewise. * testsuite/ld-elf/pr25754-5a.c: Likewise. * testsuite/ld-elf/pr25754-6a.c: Likewise. opcodes/ * aarch64-dis.c: Include stdint.h in place of bfd_stdint.h. * aarch64-dis.h: Likewise. * aarch64-opc.c: Likewise. * avr-dis.c: Likewise. * csky-dis.c: Likewise. * nds32-asm.c: Likewise. * nds32-dis.c: Likewise. * nfp-dis.c: Likewise. * riscv-dis.c: Likewise. * s12z-dis.c: Likewise. * wasm32-dis.c: Likewise.
2021-02-15bfd: use $(LN_S) in favor of "cp -p" when populating pre-built *.texiJan Beulich2-44/+44
"cp -p" has been observed to fail on Cygwin when the build tree is on a local drive but the sources are on a Samba share. We don't really need full copies of the files here - symlinks suffice.
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-01Update year range in copyright notice of binutils filesAlan Modra7-10/+10
2020-07-30Unify Solaris procfs and largefile handlingRainer Orth1-0/+1
GDB currently doesn't build on 32-bit Solaris: * On Solaris 11.4/x86: In file included from /usr/include/sys/procfs.h:26, from /vol/src/gnu/gdb/hg/master/dist/gdb/i386-sol2-nat.c:24: /usr/include/sys/old_procfs.h:31:2: error: #error "Cannot use procfs in the large file compilation environment" #error "Cannot use procfs in the large file compilation environment" ^~~~~ * On Solaris 11.3/x86 there are several more instances of this. The interaction between procfs and large-file support historically has been a royal mess on Solaris: * There are two versions of the procfs interface: ** The old ioctl-based /proc, deprecated and not used any longer in either gdb or binutils. ** The `new' (introduced in Solaris 2.6, 1997) structured /proc. * There are two headers one can possibly include: ** <procfs.h> which only provides the structured /proc, definining _STRUCTURED_PROC=1 and then including ... ** <sys/procfs.h> which defaults to _STRUCTURED_PROC=0, the ioctl-based /proc, but provides structured /proc if _STRUCTURED_PROC == 1. * procfs and the large-file environment didn't go well together: ** Until Solaris 11.3, <sys/procfs.h> would always #error in 32-bit compilations when the large-file environment was active (_FILE_OFFSET_BITS == 64). ** In both Solaris 11.4 and Illumos, this restriction was lifted for structured /proc. So one has to be careful always to define _STRUCTURED_PROC=1 when testing for or using <sys/procfs.h> on Solaris. As the errors above show, this isn't always the case in binutils-gdb right now. Also one may need to disable large-file support for 32-bit compilations on Solaris. config/largefile.m4 meant to do this by wrapping the AC_SYS_LARGEFILE autoconf macro with appropriate checks, yielding ACX_LARGEFILE. Unfortunately the macro doesn't always succeed because it neglects the _STRUCTURED_PROC part. To make things even worse, since GCC 9 g++ predefines _FILE_OFFSET_BITS=64 on Solaris. So even if largefile.m4 deciced not to enable large-file support, this has no effect, breaking the gdb build. This patch addresses all this as follows: * All tests for the <sys/procfs.h> header are made with _STRUCTURED_PROC=1, the definition going into the various config.h files instead of having to make them (and sometimes failing) in the affected sources. * To cope with the g++ predefine of _FILE_OFFSET_BITS=64, -U_FILE_OFFSET_BITS is added to various *_CPPFLAGS variables. It had been far easier to have just #undef _FILE_OFFSET_BITS in config.h, but unfortunately such a construct in config.in is commented by config.status irrespective of indentation and whitespace if large-file support is disabled. I found no way around this and putting the #undef in several global headers for bfd, binutils, ld, and gdb seemed way more invasive. * Last, the applicability check in largefile.m4 was modified only to disable largefile support if really needed. To do so, it checks if <sys/procfs.h> compiles with _FILE_OFFSET_BITS=64 defined. If it doesn't, the disabling only happens if gdb exists in-tree and isn't disabled, otherwise (building binutils from a tarball), there's no conflict. What initially confused me was the check for $plugins here, which originally caused the disabling not to take place. Since AC_PLUGINGS does enable plugin support if <dlfcn.h> exists (which it does on Solaris), the disabling never happened. I could find no explanation why the linker plugin needs large-file support but thought it would be enough if gld and GCC's lto-plugin agreed on the _FILE_OFFSET_BITS value. Unfortunately, that's not enough: lto-plugin uses the simple-object interface from libiberty, which includes off_t arguments. So to fully disable large-file support would mean also disabling it in libiberty and its users: gcc and libstdc++-v3. This seems highly undesirable, so I decided to disable the linker plugin instead if large-file support won't work. The patch allows binutils+gdb to build on i386-pc-solaris2.11 (both Solaris 11.3 and 11.4, using GCC 9.3.0 which is the worst case due to predefined _FILE_OFFSET_BITS=64). Also regtested on amd64-pc-solaris2.11 (again on Solaris 11.3 and 11.4), x86_64-pc-linux-gnu and i686-pc-linux-gnu. config: * largefile.m4 (ACX_LARGEFILE) <sparc-*-solaris*|i?86-*-solaris*>: Check for <sys/procfs.h> incompatilibity with large-file support on Solaris. Only disable large-file support and perhaps plugins if needed. Set, substitute LARGEFILE_CPPFLAGS if so. bfd: * bfd.m4 (BFD_SYS_PROCFS_H): New macro. (BFD_HAVE_SYS_PROCFS_TYPE): Require BFD_SYS_PROCFS_H. Don't define _STRUCTURED_PROC. (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Likewise. * elf.c [HAVE_SYS_PROCFS_H] (_STRUCTURED_PROC): Don't define. * configure.ac: Use BFD_SYS_PROCFS_H to check for <sys/procfs.h>. * configure, config.in: Regenerate. * Makefile.am (AM_CPPFLAGS): Add LARGEFILE_CPPFLAGS. * Makefile.in, doc/Makefile.in: Regenerate. binutils: * Makefile.am (AM_CPPFLAGS): Add LARGEFILE_CPPFLAGS. * Makefile.in, doc/Makefile.in: Regenerate. * configure: Regenerate. gas: * Makefile.am (AM_CPPFLAGS): Add LARGEFILE_CPPFLAGS. * Makefile.in, doc/Makefile.in: Regenerate. * configure: Regenerate. gdb: * proc-api.c (_STRUCTURED_PROC): Don't define. * proc-events.c: Likewise. * proc-flags.c: Likewise. * proc-why.c: Likewise. * procfs.c: Likewise. * Makefile.in (INTERNAL_CPPFLAGS): Add LARGEFILE_CPPFLAGS. * configure, config.in: Regenerate. gdbserver: * configure, config.in: Regenerate. gdbsupport: * Makefile.am (AM_CPPFLAGS): Add LARGEFILE_CPPFLAGS. * common.m4 (GDB_AC_COMMON): Use BFD_SYS_PROCFS_H to check for <sys/procfs.h>. * Makefile.in: Regenerate. * configure, config.in: Regenerate. gnulib: * configure.ac: Run ACX_LARGEFILE before gl_EARLY. * configure: Regenerate. gprof: * Makefile.am (AM_CPPFLAGS): Add LARGEFILE_CPPFLAGS. * Makefile.in: Regenerate. * configure: Regenerate. ld: * Makefile.am (AM_CPPFLAGS): Add LARGEFILE_CPPFLAGS. * Makefile.in: Regenerate. * configure: Regenerate.