aboutsummaryrefslogtreecommitdiff
path: root/contrib/binutils/bfd
Commit message (Collapse)AuthorAgeFilesLines
* Remove contrib/binutils, unused after r368667Ed Maste2020-12-16219-340012/+0
| | | | Notes: svn path=/head/; revision=368696
* Fix the following -Werror warning from clang 10.0.0 in binutils:Dimitry Andric2020-01-281-14/+14
| | | | | | | | | | | | | | | | | | | | contrib/binutils/bfd/peicode.h:1356:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (efi) ^ contrib/binutils/bfd/peicode.h:1353:8: note: previous statement is here if (pe_arch (bfd_target_efi_arch (*target_ptr)) != arch) ^ contrib/binutils/bfd/peicode.h:1370:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (!efi) ^ contrib/binutils/bfd/peicode.h:1367:8: note: previous statement is here if (pe_arch (bfd_target_pei_arch (*target_ptr)) != arch) ^ MFC after: 3 days Notes: svn path=/projects/clang1000-import/; revision=357224
* binutils: Fix bugs found by -Wpointer-compareBrooks Davis2019-10-241-1/+1
| | | | | | | | | | | | | | | The MIPS bug was introduced by upstream commit 7403cb630, which failed to account for the additional indirection introduced and also dropped one of the checks; change it to the standard "NULL-or-empty" check as used elsewhere in BFD, which is also what upstream now has. Submitted by: James Clarke <jrtc27@jrtc27.com> Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D21911 Notes: svn path=/head/; revision=354057
* Fix clang 6.0.0 compiler warnings in binutilsDimitry Andric2017-12-241-2/+2
| | | | | | | | | | | | | | | | | | | | Latest clang git has a warning -Wnull-pointer-arithmetic which will trigger a -Werror failure. Addition and subtraction from a null pointer is undefined behaviour and could be optimized into anything. Furthermore, using the difference between two pointers and casting the result back to a pointer is not portable since the size of ptrdiff_t does not necessary have to be the same as size of void* (this happens e.g. on CHERI). Using intptr_t instead fixes this portability issue and the compiler warning. Submitted by; Alexander Richardson Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D12928 MFC after: 3 days Notes: svn path=/head/; revision=327164
* bfd: avoid crash on corrupt binariesEd Maste2017-11-231-0/+20
| | | | | | | | | | | | | | From binutils commits 5a4b0ccc20ba30caef53b01bee2c0aaa5b855339 and 7e1e19887abd24aeb15066b141cdff5541e0ec8e, made available under GPLv2 by Nick Clifton. PR: 198824 MFC after: 1 week Security: CVE-2014-8501 Security: CVE-2014-8502 Notes: svn path=/head/; revision=326136
* bfd: fix segfault in the ihex parser on malformed ihex fileEd Maste2017-11-231-1/+1
| | | | | | | | | | | | From binutils commit 0102ea8cec5fc509bba6c91df61b7ce23a799d32, made available under GPLv2 by Nick Clifton. PR: 198824 MFC after: 1 week Security: CVE-2014-8503 Notes: svn path=/head/; revision=326135
* Do exception offset computations in 64 bits, not 32.Justin Hibbits2017-10-111-3/+3
| | | | | | | | | | | | This fixes clang-built binaries on a gcc powerpc64 world. Gets us one step closer to a clang-built world. The same change was made in later upstream binutils. Submitted by: rdivacky MFC after: 2 weeks Notes: svn path=/head/; revision=324511
* bfd: cast BFD_ALIGN to fix clang error on mipsEd Maste2017-08-181-1/+1
| | | | | | | | | | | | | | | error: implicit conversion from 'bfd_vma' (aka 'unsigned long long') to 'int' changes value from 18446744073709551615 to -1 return BFD_ALIGN (ret, 16); ~~~~~~ ^~~~~~~~~~~~~~~~~~~ note: expanded from macro 'BFD_ALIGN' : ~ (bfd_vma) 0) ^~~~~~~~~~~~~ Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=322670
* Bring some rough support for FreeBSD S/390 to the GNU toolchain.Pedro F. Giffuni2017-05-231-2/+2
| | | | | | | | | | | | This is no-op and only for reference: the S/390 port seems to be elusive in the BSDs so it is convenient to keep some trace from past efforts. It is likely newer attempts will focus on a newer toolchain using clang instead. Obtained from: Perforce depot/projects/s390 Notes: svn path=/head/; revision=318750
* libbfd: make sure variables are initialized before using them.Pedro F. Giffuni2016-12-161-1/+1
| | | | | | | | | | | Initialize l_sec_contents to make sure that free(l_sec_contents) is called on valid pointers. Obtained from: OpenBSD (partial CVS rev 1.18) MFC after: 5 days Notes: svn path=/head/; revision=310132
* libbfd: drop unnecessary variable increment.Pedro F. Giffuni2016-12-161-1/+1
| | | | | | | | | | Do not increment `s' before it is initialized. At the time of the increment, `s' is otherwise unused anyway. Obtained from: OpenBSD (CVS rev 1.11) Notes: svn path=/head/; revision=310131
* Create a new MACHINE_ARCH for Freescale PowerPC e500v2Justin Hibbits2016-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The Freescale e500v2 PowerPC core does not use a standard FPU. Instead, it uses a Signal Processing Engine (SPE)--a DSP-style vector processor unit, which doubles as a FPU. The PowerPC SPE ABI is incompatible with the stock powerpc ABI, so a new MACHINE_ARCH was created to deal with this. Additionaly, the SPE opcodes overlap with Altivec, so these are mutually exclusive. Taking advantage of this fact, a new file, powerpc/booke/spe.c, was created with the same function set as in powerpc/powerpc/altivec.c, so it becomes effectively a drop-in replacement. setjmp/longjmp were modified to save the upper 32-bits of the now-64-bit GPRs (upper 32-bits are only accessible by the SPE). Note: This does _not_ support the SPE in the e500v1, as the e500v1 SPE does not support double-precision floating point. Also, without a new MACHINE_ARCH it would be impossible to provide binary packages which utilize the SPE. Additionally, no work has been done to support ports, work is needed for this. This also means no newer gcc can yet be used. However, gcc's powerpc support has been refactored which would make adding a powerpcspe-freebsd target very easy. Test Plan: This was lightly tested on a RouterBoard RB800 and an AmigaOne A1222 (P1022-based) board, compiled against the new ABI. Base system utilities (/bin/sh, /bin/ls, etc) still function appropriately, the system is able to boot multiuser. Reviewed By: bdrewery, imp Relnotes: yes Differential Revision: https://reviews.freebsd.org/D5683 Notes: svn path=/head/; revision=307761
* Spell MIPS more traditionally in "bfd_elf32_ntradbigmips_vec".Brooks Davis2016-08-241-2/+2
| | | | | | | Sponsored by: DAPRA, AFRL Notes: svn path=/head/; revision=304711
* Check the first byte of the array for NUL, instead of the array as a NULL ↵Justin Hibbits2016-08-061-1/+1
| | | | | | | | | | | | | pointer The partition_name field is an array, so can never be NULL itself. Check only the first byte instead. This was found when test building with clang, but I'm not sure how it passes gcc's warnings either. Notes: svn path=/head/; revision=303797
* binutils: fix "Bad value" error in bfd for MIPS when using -Bsymbolic.Pedro F. Giffuni2016-07-211-1/+1
| | | | | | | | | | | | | From OpenBSD's log: Inspired by https://sourceware.org/ml/binutils/2010-08/msg00333.html, but expressed differently so there are no GPLv3 issues. Obtained from: OpenBSD (CVS rev. 1.7) MFC after: 1 month Notes: svn path=/head/; revision=303147
* Fix a problem in ld, causing it to sometimes print messages similar toDimitry Andric2016-02-221-2/+2
| | | | | | | | | | | | | | | "invalid string offset 65521 >= 27261 for section `.strtab'". for object files produced by recent versions of clang. In BFD's elf_create_symbuf() function, the size of the symbol buffer ('ssymbuf') is not calculated correctly, and the initial value for the 'ssym' variable is off by one, since 'ssymbuf' has shndx_count + 1 members. MFC after: 1 week Notes: svn path=/head/; revision=295901
* Unconditionally set e_ident[OSABI]=ELFOSABI_FREEBSD in arm binary headers.Ian Lepore2016-02-211-12/+2
| | | | | | | | | | | | When the armv6 support was imported from a project branch, this complex conditional logic and related #define'd values came along, but it's really not clear what the intent of it all was. The effect, however, was that OSABI was always set to zero, which is "UNIX System V ABI". Having the wrong value there causes pkg(8) to avoid looking inside arm elf binaries to determine shared-lib required/provides info for packaging. Notes: svn path=/head/; revision=295857
* Add the MOVT/MOVW types to the list of relocs which do not generate .pltIan Lepore2015-12-301-6/+20
| | | | | | | | | entries. This fixes the segfaults in arm userland code compiled with -march= or -mcpu= values that allow the compiler to generate movw/movt sequences to load 32-bit constants. Notes: svn path=/head/; revision=292964
* Correct the code for sign-extending a 16 bit value. As near as I can tellIan Lepore2015-12-291-1/+1
| | | | | | | | this is effectively a no-op -- the addend term in MOVT/MOVW relocations always seems to be zero. But this is correct and the old code wasn't. Notes: svn path=/head/; revision=292870
* Copy new attribute types when linking. bfd will copy attributes as needed,Andrew Turner2015-05-051-0/+3
| | | | | | | | | | | | | however it will fail to output them if the type is not set correctly. This can happen when it finds an attribute it hasn't seen before, for example when building shared objects it will use the attributes from crti.o, hwever this file has no attributes set. Differential Revision: https://reviews.freebsd.org/D2413 Reviewed by: imp Notes: svn path=/head/; revision=282471
* For eabi 5 (what FreeBSD uses), be sure to tag all executables andWarner Losh2015-05-031-0/+10
| | | | | | | | | | shared libraries as either SOFT or HARD float to comply with the EABI standard. Differential Revision: https://reviews.freebsd.org/D2401 Notes: svn path=/head/; revision=282380
* When merging the floating point type attribute, and reporting an errorWarner Losh2015-05-031-1/+14
| | | | | | | | | | when things don't match, report which file has them and which one doesn't correctly. Differential Revision: https://reviews.freebsd.org/D2400 Notes: svn path=/head/; revision=282379
* More ARM EABI object attributes in binutils. This adds support to binutilsAndrew Turner2015-04-032-2/+6
| | | | | | | | | | | | | | | | | to include the Unaligned Access and Floating-point Half-precision attributes. the former marks ELF objects that may access ARMv6 style unaligned data, the latter that the binary uses the VFPv3/Advanced SIMD half-precision extension. These may be emmitted by clang so it's best to print a warning when the linker hits one of them. Differential Revision: http://reviews.freebsd.org/D2194 Submitted by: Michal Meloun <meloun@miracle.cz> MFC after: 1 week Notes: svn path=/head/; revision=281048
* GNU nm: Avoid NULL dereferenceEd Maste2015-02-251-1/+2
| | | | | | | | | | | | | | bfd_dwarf2_find_line() calls find_line() with NULL functionname_ptr, which resulted in a crash on certain ELF objects. This change was implemented independently from upstream binutils, but I have checked that the crash does not happen there. MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=279301
* Add pregenerated documentation for as(1) and ld(1)Baptiste Daroussin2015-01-041-0/+1
| | | | Notes: svn path=/head/; revision=276651
* In contrib/binutils/bfd/elf32-ppc.c, avoid warnings about case valuesDimitry Andric2014-12-291-1/+1
| | | | | | | | | | not being in the enumerated type 'enum elf_ppc_reloc_type', by casting the switch argument to int. MFC after: 3 days Notes: svn path=/head/; revision=276352
* Add new PowerPC relocations to binutilsJustin Hibbits2014-12-128-814/+1407
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: LLVM/Clang generates relocations that our binutils doesn't understand, but newer binutils does. I got permission from the author of a series of patches to relicense them as GPLv2 for use in FreeBSD. The upstream git hashes are: ac2df442ac7901f00af15b272fc48b594b433713 2b95367962dc14f69d3c338c4d54195266e2e169 102890f04c44b64cf5cef4588267dd9f24086ac7 b7fcf6f6bb53b5027e111107f5416769cb9a5798 1d483afedd5a628dc84fb58d1d570f79fdfbfa7b 90aecf7a80c1cefeb45fc10a6cd02c8338e34b4c 3a71aa26df2a372a58e9c11ef9ba51fd0e83320a 727fc41e077139570ea8b8ddfd6c546b2a55627c With the import of clang 3.5, and a few backported patches, we should be able to move powerpc and powerpc64 to clang-as-cc soon. Test Plan: Passes make tinderbox, so no regressions. Binaries built with clang run on powerpc64. Reviewers: #committers, dim Reviewed By: dim Differential Revision: https://reviews.freebsd.org/D1297 Obtained from: Alan Modra, upstream binutils-gdb git MFC after: 3 weeks Relnotes: yes Notes: svn path=/head/; revision=275718
* Let GNU ld be less obscure about missing symbols and DSOs. If the BFDDimitry Andric2014-12-022-4/+33
| | | | | | | | | | | | | | | | | object looks like a typical shared library, suggest adding '-l<foo>', where <foo> has the 'lib' prefix and '.so<bar>' or '.a' suffix removed. Otherwise, suggest adding '-l:<foo>', where <foo> is the full DT_SONAME. Submitted by: Conrad Meyer <conrad.meyer@isilon.com> Sponsored by: EMC / Isilon storage division Reviewed by: emaste PR: 194296 MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D1152 Notes: svn path=/head/; revision=275386
* Use llabs when getting the absolute value of a long long.Andrew Turner2014-11-301-10/+10
| | | | | | | Sponsored by: ABT Ststems Ltd Notes: svn path=/head/; revision=275336
* Rename elf*-powerpc into elf*-powerpc-freebsd in binutilsBaptiste Daroussin2014-10-102-2/+2
| | | | | | | | | | | | | | | | The powerpc support was the only supported architecture not prepending the elf format name with "-freebsd" in base this change makes it consistent with other architectures. On newer version of binutils the powerpc format is also prepended with "-freebsd". Also modify the kernel ldscripts in that regards. As a result it is now possible cross build the kernel on powerpc using newer binutils Differential Revision: https://reviews.freebsd.org/D926 Differential Revision: https://reviews.freebsd.org/D928 Notes: svn path=/head/; revision=272888
* Merge the big-endian ARM targets together, and the little-endian ARMAndrew Turner2014-10-051-10/+2
| | | | | | | | targets. With this we assume any ARM target containing eb is big-endian, otherwise it is little-endian. Notes: svn path=/head/; revision=272564
* Silence a warning about Tag_Virtualization_use being unknown. We don'tAndrew Turner2014-10-041-1/+2
| | | | | | | handle merging this tag correctly, however it's unused. Notes: svn path=/head/; revision=272524
* Add a new ARM TARGET_ARCH, armv6hf. This is considered experimental.Andrew Turner2014-03-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This targets the existing ARMv6 and ARMv7 SoCs that contain a VFP unit. This is an optional coprocessors may not be present in all devices, however it appears to be in all current SoCs we support. armv6hf targets the VFP variant of the ARM EABI and our copy of gcc is too old to support this. Because of this there are a number of WITH/WITHOUT options that are unsupported and must be left as the default value. The options and their required value are: * WITH_ARM_EABI * WITHOUT_GCC * WITHOUT_GNUCXX In addition, without an external toolchain, the following need to be left as their default: * WITH_CLANG * WITH_CLANG_IS_CC As there is a different method of passing float and double values to functions the ABI is incompatible with existing armv6 binaries. To use this a full rebuild of world is required. Because no floating point values are passed into the kernel an armv6 kernel with VFP enabled will work with an armv6hf userland and vice versa. Notes: svn path=/head/; revision=263660
* binutils/bfd: fix printf-like format strings for "bfd *" argumentsEygene Ryabinkin2013-10-293-5/+5
| | | | | | | | | | | | | | There is a special format argument '%B' that directly handles values of type 'bfd *', they must be used instead of '%s'. Manifestations of this bug can be seen in ld(1) error messages, for example, http://lists.freebsd.org/pipermail/freebsd-current/2013-August/043580.html http://lists.freebsd.org/pipermail/freebsd-current/2013-October/045404.html Approved by: dim MFC after: 2 weeks Notes: svn path=/head/; revision=257302
* Use correct size for MIPS .rld_map sectionEd Maste2013-10-021-1/+5
| | | | | | | | | | | | | On MIPS .dynamic is read-only and so a special section .rld_map is used to store the pointer to the rtld information for debuggers. This section had a hard coded size of 4 bytes which is not correct for mips64. (Note that FreeBSD's rtld does not yet populate .rld_map.) Sponsored by: DARPA, AFRL Approved by: re (delphij) Notes: svn path=/head/; revision=255982
* Fix a bug in ld, where indirect symbols are not handled properly duringDimitry Andric2013-09-281-3/+19
| | | | | | | | | | | | linking of a shared library, leading to corrupt indexes in the dynamic symbol table. This should fix the multimedia/ffmpegthumbnailer port. Approved by: re (kib) Reported by: swills MFC after: 2 weeks Notes: svn path=/head/; revision=255931
* Revert: Use time_t instead of long for archive timestamps.Pedro F. Giffuni2013-06-017-24/+15
| | | | | | | Back out for now: this breaks the i386 build and requires some revision. Notes: svn path=/head/; revision=251227
* BFD: Use time_t instead of long for archive timestamps.Pedro F. Giffuni2013-06-017-15/+24
| | | | | | | | | | | This basically follows the suggestion in the binutils code and is more in line with what BSD ar(1) does. Obtained from: OpenBSD MFC after: 2 weeks. Notes: svn path=/head/; revision=251225
* Similar to r239870 and r239872, teach the other binutils tools about theDimitry Andric2013-03-271-0/+3
| | | | | | | | | | | DW_FORM_flag_present dwarf attribute, so they do not print errors or warnings on files that contain it. (This attribute can be emitted by newer versions of clang and gcc.) MFC after: 1 week Notes: svn path=/head/; revision=248802
* Fix a bug in ld --gc-sections: it strips out .note sections, while itDimitry Andric2012-12-221-0/+1
| | | | | | | | | | | | should never do so. This can cause global constructors and destructors to not be executed at run-time, resulting in crashes and other strange behaviour. Reported by: rene MFC after: 1 week Notes: svn path=/head/; revision=244600
* Merging of projects/armv6, part 3Oleksandr Tymoshenko2012-08-151-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | r238211: Support TARGET_ARCH=armv6 and TARGET_ARCH=armv6eb This adds a new TARGET_ARCH for building on ARM processors that support the ARMv6K multiprocessor extensions. In particular, these processors have better support for TLS and mutex operations. This mostly touches a lot of Makefiles to extend existing patterns for inferring CPUARCH from ARCH. It also configures: * GCC to default to arm1176jz-s * GCC to predefine __FreeBSD_ARCH_armv6__ * gas to default to ARM_ARCH_V6K * uname -p to return 'armv6' * make so that MACHINE_ARCH defaults to 'armv6' It also changes a number of headers to use the compiler __ARM_ARCH_XXX__ macros to configure processor-specific support routines. Submitted by: Tim Kientzle <kientzle@freebsd.org> Notes: svn path=/head/; revision=239272
* Fix clang warnings.Ben Laurie2011-06-183-3/+3
| | | | | | | Approved by: philip (mentor) Notes: svn path=/head/; revision=223262
* In the upstream rev. 1.61 of elf64-sparc.c the following bug was fixed:Marius Strobl2011-03-111-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | * elf64-sparc.c (sparc64_elf_relocate_section): Adjust addend of dynamic relocs against section symbols for the output section vma. However, with the addition of TLS support in the upstream rev. 1.104 this fix was essentially reverted. After factoring out the common parts of elf32-sparc.c and elf64-sparc.c a comment was added to elfxx-sparc.c in the upstream rev. 1.27 as part of unrelated changes, saying that the fix from elf64-sparc.c rev. 1.61 indeed should be implemented, but given that some unspecified OS has a broken ld.so expecting broken relocations deliberately is omitted. As the current behavior actually violates the SPARC ABI, FreeBSD never had such a broken ld.so and this is actually causing problems with at least kernel modules linked with binutils 2.17.50 committed in r218822 without the workaround committed in r219340 in place, re-implement the above fix in a way so that is only applied if the output format is ELFOSABI_FREEBSD. In the upstream version it probably would make sense to invert this check and only skip adjusting the addend for the OS with the broken ld.so, once it's determine which one that is. Approved by: dim Notes: svn path=/head/; revision=219530
* Merge binutils 2.17.50 to head. This brings a number of improvements toDimitry Andric2011-02-18219-67873/+107005
|\ | | | | | | | | | | | | | | | | | | | | | | x86 CPU support, better support for powerpc64, some new directives, and many other things. Bump __FreeBSD_version, and add a note to UPDATING. Thanks to the many people that have helped to test this. Obtained from: projects/binutils-2.17 Notes: svn path=/head/; revision=218822
| * Try a more generic version of the last two fixes. Assuming this is correct,Nathan Whitehorn2010-12-071-4/+1
| | | | | | | | | | | | | | | | | | | | | | it should also be MI. The problem here arises when ld ends up linking a link-once section with relocations against sections that point back to it that are as yet unresolved. Instead of piecemeal finding sections we think are potentially subject to this issue, just defer processing for sections that have yet to be relocated instead of immediately bailing. Notes: svn path=/projects/binutils-2.17/; revision=216281
| * Fix another .got references-in-linkonce-sections issue with C++. There areNathan Whitehorn2010-12-071-0/+3
| | | | | | | | | | | | | | | | | | remaining issues here, and a more general solution is probably called for. Submitted by: Jakob van Santen <vansanten@wisc.edu> Notes: svn path=/projects/binutils-2.17/; revision=216278
| * For ia64, add a proper 'elf64-ia64-freebsd' output format to BFD, so theDimitry Andric2010-12-052-0/+21
| | | | | | | | | | | | | | | | | | ELF branding for FreeBSD is done in the same way as amd64, i386 and sparc. Something similar should probably also be done for arm, mips and powerpc. Notes: svn path=/projects/binutils-2.17/; revision=216200
| * Sync: merge r215464 through r215708 from ^/head.Dimitry Andric2010-11-222-0/+40
| |\ | |/ |/| | | Notes: svn path=/projects/binutils-2.17/; revision=215710
| * Sync: merge r215189 through r215272 from ^/head.Dimitry Andric2010-11-141-4/+8
| |\ | | | | | | | | | Notes: svn path=/projects/binutils-2.17/; revision=215273
| * \ Sync: merge r214895 through r215140 from ^/head.Dimitry Andric2010-11-111-1/+1
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/binutils-2.17/; revision=215143