aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-01-14Fix snafu in version number. Regenerate filesbinutils-2_40Nick Clifton6-33/+33
2023-01-14Set development and experimental to false. Update version number to 2.40. ↵Nick Clifton27-576/+102845
Add release markers. Regenerate files
2023-01-14Automatic date update in version.inGDB Administrator1-1/+1
2023-01-13Updated Romainian translation for the bfd sub-directoryNick Clifton2-2742/+2820
2023-01-13Automatic date update in version.inGDB Administrator1-1/+1
2023-01-12ARM: Fix ld bloat introduced between binutils-2.38 and 2.39Hans-Peter Nilsson1-4/+0
Since commit 9833b7757d24, "PR28824, relro security issues", ELF_MAXPAGESIZE matters much more, with regards to layout of the linked file. That commit fixed an actual bug, but also exposes a problem for targets were that value is too high. For example, for ARM(32, a.k.a. "Aarch32") specifically bfd_arch_arm, it's set to 64 KiB, making all Linux(/GNU) targets pay an extra amount of up to 60 KiB of bloat in DSO:s and executables. This matters when there are many such files, and where storage is expensive. It's *mostly* bloat when using a Linux kernel, as ARM(32) is a good example of an target where ELF_MAXPAGESIZE is set to an extreme value for an obscure corner-case. The ARM (32-bit) kernel has 4 KiB pages, has had that value forever, and can't be configured to any other value. The use-case is IIUC "Aarch32" emulation on an "Aarch64" (arm64) kernel, but not just that, but a setup where the Linux page-size is configured to something other than the *default* 4 KiB. Not sure there actually any such systems in use, again with both Aarch32 compatibility support and a non-4KiB pagesize, with all the warnings in the kernel config and requiring the "EXPERT" level set on. So, let's do like x86-64 in a2267dbfc9e1 "x86-64: Use only one default max-page-size" and set ELF_MAXPAGESIZE to 4096. bfd: * elf32-arm.c (ELF_MAXPAGESIZE): Always set to 0x1000. (cherry picked from commit 1a26a53a0dee39106ba58fcb15496c5f13074652)
2023-01-12ld/testsuite: Adjust for ELF_MAXPAGESIZE 0x1000Hans-Peter Nilsson7-29/+32
Many tests reflect a setting of ELF_MAXPAGESIZE to 64 KiB. With ELF_MAXPAGESIZE changed to 4 KiB, layout is sometimes different and symbols end up in other places. Avoid churn and regexpification of old test patterns by passing the max-page-size setting active at the time. ld/testsuite: * testsuite/ld-arm/arm-elf.exp, testsuite/ld-arm/non-contiguous-arm2.d, testsuite/ld-arm/non-contiguous-arm3.d, testsuite/ld-arm/non-contiguous-arm5.d, testsuite/ld-arm/non-contiguous-arm6.d, testsuite/ld-arm/thumb-plt-got.d, testsuite/ld-arm/thumb-plt.d: Pass -z max-page-size=0x10000 explicitly to test that rely on that value in output-matching patterns. (cherry picked from commit b305015577bb92d3041e55a72ca8cd43f7c05748)
2023-01-12libctf: ctf-link outdated input check faultyNick Alcock1-6/+29
This check has a pair of faults which, combined, can lead to memory corruption. Firstly, it assumes that the values of the ctf_link_inputs hash are ctf_dict_t's: they are not, they are ctf_link_input_t's, a much shorter structure. So the flags check which is the core of this is faulty (but happens, by chance, to give the right output on most architectures, since usually we happen to get a 0 here, so the test that checks this usually passes). Worse, the warning that is emitted when the test fails is added to the wrong dict -- it's added to the input dict, whose warning list is never consumed, rendering the whole check useless. But the dict it adds to is still the wrong type, so we end up overwriting something deep in memory (or, much more likely, dereferencing a garbage pointer and crashing). Fixing both reveals another problem: the link input is an *archive* consisting of multiple members, so we have to consider whether to check all of them for the outdated-func-info thing we are checking here. However, no compiler exists that emits a mixture of members with this flag on and members with it off, and the linker always reserializes (and upgrades) such things when it sees them: so all members in a given archive must have the same value of the flag, so we only need to check one member per input archive. libctf/ PR libctf/29983 * ctf-link.c (ctf_link_warn_outdated_inputs): Get the types of members of ctf_link_inputs right, fixing a possible spurious tesst failure / wild pointer deref / overwrite. Emit the warning message into the right dict.
2023-01-12Ensure that libbacktrace/allocfail.sh is not deleted when creating release ↵Nick Clifton3-2/+7
tarballs. * Makefile.am (CLEANFILES): Import patch from upstream to prevent allocafail.sh from being removed when running 'make clean'.
2023-01-12Automatic date update in version.inGDB Administrator1-1/+1
2023-01-11Fix a potential illegal memory access in the BFD library when parsing a ↵Nick Clifton2-1/+7
corrupt DWARF file. PR 29988 * dwarf2.c (read_indexed_address): Fix check for an out of range offset.
2023-01-11gas/RISC-V: adjust assembler for opcode table re-orderingJan Beulich1-0/+11
PR gas/29940 With the single-operand JAL entry now sitting ahead of the two-operand one, the parsing of a two-operand insn would first try to parse an 'a'- style operand, resulting in the insertion of bogus (and otherwise unused) undefined symbols in the symbol table, having register names. Since 'a' is used as 1st operand only with J and JAL, and since JAL is the only insn _also_ allowing for a register as 1st operand (and then there being a 2nd one), special case this parsing aspect right there. Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-01-11Automatic date update in version.inGDB Administrator1-1/+1
2023-01-10IBM zSystems: Fix offset relative to static TLSStefan Schulze Frielinghaus4-4/+24
For local exec TLS relocations of the form foo@NTPOFF+x the addend was ignored. bfd/ChangeLog: * elf32-s390.c (elf_s390_relocate_section): Honor addend for R_390_TLS_LE32. * elf64-s390.c (elf_s390_relocate_section): Honor addend for R_390_TLS_LE64. ld/ChangeLog: * testsuite/ld-s390/reloctlsle-1.d: New test. * testsuite/ld-s390/reloctlsle-1.s: New test. (cherry picked from commit aefebe82dc89711384b85329daa48d04c1d3a45b)
2023-01-10Automatic date update in version.inGDB Administrator1-1/+1
2023-01-09sframe: fix the defined SFRAME_FRE_TYPE_*_LIMIT constantsIndu Bhagat4-12/+17
An earlier commit 3f107464 defined the SFRAME_FRE_TYPE_*_LIMIT constants. These constants are used (by gas and libsframe) to pick an SFrame FRE type based on the function size. Those constants, however, were buggy, causing the generated SFrame sections to be bloated as SFRAME_FRE_TYPE_ADDR2/SFRAME_FRE_TYPE_ADDR4 got chosen more often than necessary. gas/ * sframe-opt.c (sframe_estimate_size_before_relax): Use typecast. (sframe_convert_frag): Likewise. libsframe/ * sframe.c (sframe_calc_fre_type): Use a more appropriate type for argument. Adjust the check for SFRAME_FRE_TYPE_ADDR4_LIMIT to keep it warning-free but meaningful. include/ * sframe-api.h (sframe_calc_fre_type): Use a more appropriate type for the argument. * sframe.h (SFRAME_FRE_TYPE_ADDR1_LIMIT): Correct the constant. (SFRAME_FRE_TYPE_ADDR2_LIMIT): Likewise. (SFRAME_FRE_TYPE_ADDR4_LIMIT): Likewise. (cherry picked from commit 725a19bfd142c845bf76ae28f6289972fd1cf5db)
2023-01-09libsframe: adjust an incorrect check in flip_sframeIndu Bhagat1-9/+13
When sframe_encoder_write needs to flip the buffer containing the SFrame section before writing, it is not necessary that the SFrame FDES are in the order of their sfde_func_start_fre_off. On the contrary, SFrame FDEs will be sorted in the order of their start address. So, remove this incorrect assumption which is basically assuming that the last sfde_func_start_fre_off seen will help determine the end of the flipped buffer. The function now keeps track of the bytes_flipped and then compares it with the expected value. Also, added two more checks at appropriate places: - check that the SFrame FDE read is within bounds - check that the SFrame FRE read is within bounds libsframe/ * sframe.c (flip_sframe): Adjust an incorrect check. Add other checks to ensure reads are within the buffer size. (cherry picked from commit cd9aea32cffd8089f6f63f4eb86d4dccfc0b3850)
2023-01-09Skip ld/pr23169 test on arm.Christophe Lyon1-3/+4
The test is already skipped on several targets (including AArch64) because it's invalid. * testsuite/ld-ifunc/ifunc.exp: Skip pr23169 on arm.
2023-01-09Fix PR18841 ifunc relocation orderingChristophe Lyon4-39/+68
In order to get the ifunc relocs properly sorted the correct class needs to be returned. The code mimics what has been done for AArch64. Fixes: FAIL: Run pr18841 with libpr18841b.so FAIL: Run pr18841 with libpr18841c.so FAIL: Run pr18841 with libpr18841bn.so (-z now) FAIL: Run pr18841 with libpr18841cn.so (-z now) bfd/ PR ld/18841 * elf32-arm.c (elf32_arm_reloc_type_class): Return reloc_class_ifunc for ifunc symbols. ld/testsuite/ * ld-arm/ifunc-12.rd: Update relocations order. * ld-arm/ifunc-3.rd: Likewise. * ld-arm/ifunc-4.rd: Likewise.
2023-01-09Updated transaltions for the gprof and binutils sub-directoriesNick Clifton5-5991/+7202
2023-01-09Automatic date update in version.inGDB Administrator1-1/+1
2023-01-08PR29972, inconsistent format specification in singular formAlan Modra1-1/+1
PR 29972 * readelf.c (process_dynamic_section): Correct format string. (cherry picked from commit 02da71ee20ec71f7b3be85cf2266e09c124983bf)
2023-01-08Automatic date update in version.inGDB Administrator1-1/+1
2023-01-07Automatic date update in version.inGDB Administrator1-1/+1
2023-01-06ld: yet another PDB build fix (or workaround)Jan Beulich2-16/+24
Older bash looks to improperly deal with backslashes in here-documents, leaving them in place on the escaped double quotes inside the parameter expansion. Convert to a model without using such a construct, by simply splitting the here-documents into three ones.
2023-01-06Updated Bulgarian and Russian translations for LD and BFD respectivelyNick Clifton4-4095/+5104
2023-01-06Automatic date update in version.inGDB Administrator1-1/+1
2023-01-05Avoid unaligned pointer reads in PEP idata sectionNick Clifton3-50/+50
2023-01-05Updated Bulgarian and Russian translations for the gprof subdirectoryNick Clifton3-229/+205
2023-01-05Automatic date update in version.inGDB Administrator1-1/+1
2023-01-04Merge config/picflag.m4 from gccAlan Modra2-3/+4
2023-01-04Update some more copyright year rangesAlan Modra7-7/+7
These files disappear in commit 3002e78a7d3d but are still on the branch.
2023-01-04Update year range in gprofng copyright noticesAlan Modra286-287/+288
This adds 'Innovative Computing Labs' as an external author to update-copyright.py, to cover the copyright notice in gprofng/common/opteron_pcbe.c, and uses that plus another external author 'Oracle and' to update gprofng copyright dates. I'm not going to commit 'Oracle and' as an accepted author, but that covers the string "Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved." found in gprofng/testsuite/gprofng.display/jsynprog files.
2023-01-04Update year range in copyright notice of binutils filesAlan Modra2786-3123/+3125
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.
2023-01-04Update etc/update-copyright.pyAlan Modra1-11/+33
This picks up some improvements from gcc/contrib. exceptions must derive from BaseException, port to python3, retain original file mode, fix name of script in examples. Adds libsframe to list of default dirs. I would have added gprofng too but there are some files claiming copyright by authors other than the Free Software Foundation.
2023-01-04Fix AArch64 linker testsuite failures triggered by differences in build ↵Andreas K. Huettel3-5/+12
environments. PR 29843 * testsuite/ld-aarch64/bti-plt-5.d: Relax regxps slightly to allow for differences in build environments. * testsuite/ld-aarch64/tls-relax-gdesc-le-now.d: Likewise.
2023-01-04Avoid unaligned pointer reads in PEP .idata sectionMark Harmstone1-0/+1
This is something I discovered when working on aarch64, though it's relevant to x86_64 too. The PE32+ imports are located in the .idata section, which starts off with a 20-byte structure for each DLL, containing offsets into the rest of the section. This is the Import Directory Table in https://learn.microsoft.com/en-us/windows/win32/debug/pe-format, which is a concatenation of the .idata$2 sections. This is then followed by an 20 zero bytes generated by the linker script, which calls this .idata$3. After this comes the .idata$4 entries for each function, which the loader overwrites with the function pointers. Because there's no padding between .idata$3 and .idata$4, this means that if there's an even number of DLLs, the function pointers won't be aligned on an 8-byte boundary. Misaligned reads are slower on x86_64, but this is more important on aarch64, as the e.g. `ldr x0, [x0, :lo12:__imp__func]` the compiler might generate requires __imp__func (the .idata$4 entry) to be aligned to 8 bytes. Without this you get IMAGE_REL_ARM64_PAGEOFFSET_12L overflow errors.
2023-01-04Automatic date update in version.inGDB Administrator1-1/+1
2023-01-03Updated translations for various languages and sub-directoriesNick Clifton23-17502/+18901
2023-01-03Automatic date update in version.inGDB Administrator1-1/+1
2023-01-02Automatic date update in version.inGDB Administrator1-1/+1
2022-12-31Update version number and regenerate filesNick Clifton17-8985/+9918
2022-12-31Add markers for 2.40 branchNick Clifton18-3/+61
2022-12-31sync libiberty sources with gcc mainlineNick Clifton9-111/+737
2022-12-31[gdb/cli] Add maintenance ignore-probesTom de Vries4-0/+145
There's a command "disable probes", but SystemTap probes, for instance libc:longjmp cannot be disabled: ... $ gdb -q -batch a.out -ex start -ex "disable probes libc ^longjmp$" ... Probe libc:longjmp cannot be disabled. Probe libc:longjmp cannot be disabled. Probe libc:longjmp cannot be disabled. ... Add a command "maintenance ignore-probes" that ignores probes during get_probes, such that we can easily pretend to use a libc without the libc:longjmp probe: ... (gdb) maint ignore-probes -verbose libc ^longjmp$ ignore-probes filter has been set to: PROVIDER: 'libc' PROBE_NAME: '^longjmp$' OBJNAME: '' (gdb) start ^M ... Ignoring SystemTap probe libc longjmp in /lib64/libc.so.6.^M Ignoring SystemTap probe libc longjmp in /lib64/libc.so.6.^M Ignoring SystemTap probe libc longjmp in /lib64/libc.so.6.^M ... The "Ignoring ..." messages can be suppressed by not using -verbose. Note that as with "disable probes", running simply "maint ignore-probes" ignores all probes. The ignore-probes filter can be reset by using: ... (gdb) maint ignore-probes -reset ignore-probes filter has been reset ... For now, the command is only supported for SystemTap probes. PR cli/27159 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27159
2022-12-31ld/testsuite: Don't add index to sizes in pdb.expMark Harmstone1-3/+3
2022-12-31ld: Handle LF_VFTABLE types in PDBsMark Harmstone6-4/+73
2022-12-31ld: Handle extended-length data structures in PDB typesMark Harmstone6-28/+344
A few fixes to minor issues I've discovered in my PDB patches. * If sizes or offsets are greater than 0x8000, they get encoded as extended values in the same way as for enum values - e.g. a LF_ULONG .short followed by a .long. * I've managed to coax MSVC to produce another type, LF_VFTABLE, which is seen when dealing with COM. I don't think LLVM emits this. Note that we can't just implement everything in Microsoft's header files, as most of it is obsolete. * Fixes a stupid bug in the test program, where I was adding an index to a size. The index was hard-coded to 0, so this didn't cause any actual issues.
2022-12-31Updated Romanian translation for the binutils sub-directoryNick Clifton3-826/+1032
2022-12-31[gdb/python] Fix gdb.python/py-finish-breakpoint2.exp for -m32Tom de Vries3-6/+55
[ Partial resubmission of an earlier submission by Andrew ( https://sourceware.org/pipermail/gdb-patches/2012-September/096347.html ), so listing him as co-author. ] With x86_64-linux and target board unix/-m32, we have: ... (gdb) continue^M Continuing.^M Exception #10^M ^M Breakpoint 3, throw_exception_1 (e=10) at py-finish-breakpoint2.cc:23^M 23 throw new int (e);^M (gdb) FAIL: gdb.python/py-finish-breakpoint2.exp: \ check FinishBreakpoint in catch() ... The following scenario happens: - set breakpoint in throw_exception_1, a function that throws an exception - continue - hit breakpoint, with call stack main.c:38 -> throw_exception_1 - set a finish breakpoint - continue - hit the breakpoint again, with call stack main.c:48 -> throw_exception -> throw_exception_1 Due to the exception, the function call did not properly terminate, and the finish breakpoint didn't trigger. This is expected behaviour. However, the intention is that gdb detects this situation at the next stop and calls the out_of_scope callback, which would result here in this test-case in a rather confusing "exception did not finish" message. So the problem is that this message doesn't show up, in other words, the out_of_scope callback is not called. [ Note that the fact that the situation is detected only at the next stop (wherever that happens to be) could be improved upon, and the earlier submission did that by setting a longjmp breakpoint. But I'm considering this problem out-of-scope for this patch. ] Note that the message does show up later, at thread exit: ... [Inferior 1 (process 20046) exited with code 0236]^M exception did not finish ...^M ... The decision on whether to call the out_of_scope call back is taken in bpfinishpy_detect_out_scope_cb, and the interesting bit is here: ... if (b->pspace == current_inferior ()->pspace && (!target_has_registers () || frame_find_by_id (b->frame_id) == NULL)) bpfinishpy_out_of_scope (finish_bp); ... In the case of the thread exit, the callback triggers because target_has_registers () == 0. So why doesn't the callback trigger in the case of the breakpoint? Well, the b->frame_id is the frame_id of the frame of main (the frame in which the finish breakpoint is supposed to trigger), so AFAIU frame_find_by_id (b->frame_id) == NULL will only be true once we've left main, at which point I guess we don't stop till thread exit. Fix this by saving the frame in which the finish breakpoint was created, and using frame_find_by_id () == NULL on that frame instead, such that we have: ... (gdb) continue^M Continuing.^M Exception #10^M ^M Breakpoint 3, throw_exception_1 (e=10) at py-finish-breakpoint2.cc:23^M 23 throw new int (e);^M exception did not finish ...^M (gdb) FAIL: gdb.python/py-finish-breakpoint2.exp: \ check FinishBreakpoint in catch() ... Still, the test-case is failing because it's setup to match the behaviour that we get on x86_64-linux with target board unix/-m64: ... (gdb) continue^M Continuing.^M Exception #10^M stopped at ExceptionFinishBreakpoint^M (gdb) PASS: gdb.python/py-finish-breakpoint2.exp: \ check FinishBreakpoint in catch() ... So what happens here? Again, due to the exception, the function call did not properly terminate, but the finish breakpoint still triggers. This is somewhat unexpected. This happens because it just so happens to be that the frame return address at which the breakpoint is set, is also the first instruction after the exception has been handled. This is a know problem, filed as PR29909, so KFAIL it, and modify the test-case to expect the out_of_scope callback. Also add a breakpoint after setting the finish breakpoint but before throwing the exception, to check that we don't call the out_of_scope callback too early. Tested on x86_64-linux, with target boards unix/-m32. Co-Authored-By: Andrew Burgess <aburgess@redhat.com> PR python/27247 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27247