aboutsummaryrefslogtreecommitdiff
path: root/contrib/binutils
Commit message (Collapse)AuthorAgeFilesLines
* GNU as: move deprecation message after option parsingEd Maste2020-05-181-1/+1
| | | | | | | | | | | | | | | | | Some cmake test parses the output of the first line of as --version, and emits an error if it does not contain some expected strings: Checking whether the ASM compiler is GNU using "--version" did not match "(GNU assembler)|(GCC)|(Free Software Foundation)" Emit the deprecation message later, after parsing argv and thus --version. PR: 246540 Reported by: dch Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=361218
* GNU as: print a deprecation warning on program startEd Maste2020-05-061-0/+1
| | | | | | | GNU as 2.17.50 will be removed before FreeBSD 13. Notes: svn path=/head/; revision=360679
* gas: mark dwarf2_loc_mark_labels as externKyle Evans2020-03-281-1/+1
| | | | | | | | | Compiling with -fno-common complains as this header's included in multiple compilation units. In fact, the proper definition of dwarf2_loc_mark_labels already exists in dwarf2dbg.c, so simply mark this declaration with extern. Notes: svn path=/head/; revision=359388
* objdump: emit a deprecation notice at program startEd Maste2020-03-271-0/+2
| | | | | | | PR: 212319 Notes: svn path=/head/; revision=359377
* 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-242-2/+2
| | | | | | | | | | | | | | | 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
* as: add deprecation notice to the man pageEd Maste2019-08-011-0/+3
| | | | | | | | | | | | | | | | | | | In the future FreeBSD will ship without GNU binutils 2.17.50. Add a note advising users who require GNU as to install the binutils port or package. Note that on armv7, arm64, amd64, i386 we currently ship only two binutils tools (as and objdump). A deprecation notice was added to objdump's man page some time ago. PR: 233611 Discussed with: jhb MFC after: 1 week Relnotes: Yes Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=350518
* objdump: be explicit that GNU objdump that will be removedEd Maste2019-08-011-2/+2
| | | | | | | | | | | We may install llvm-objdump as objdump (see review D18307) or just provide no /usr/bin/objdump, but either way GNU objdump won't be installed in the future. MFC after: 3 days Notes: svn path=/head/; revision=350505
* Fix binutils compilation error with Clang 8Justin Hibbits2019-03-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change fixes the following compilation error when using clang 8 to cross compile base to powerpc64: ``` /usr/src/gnu/usr.bin/binutils/libopcodes/../../../../contrib/binutils/opcodes/ppc-dis.c:100:35: error: arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension [-Werror,-Wnull-pointer-arithmetic] info->private_data = (char *) 0 + dialect; ~~~~~~~~~~ ^ 1 error generated. *** [ppc-dis.o] Error code 1 make[6]: stopped in /usr/src/gnu/usr.bin/binutils/libopcodes 1 error ``` Test Plan: - buildworld for x86_64 (native) - buildworld for powerpc64 (cross) - buildworld for powerpc64 (native) Submitted by: alfredo.junior_eldorado.org.br Reviewed By: emaste, pfg, brooks Differential Revision: https://reviews.freebsd.org/D19235 Notes: svn path=/head/; revision=344791
* Add deprecation notice to objdump man pageEd Maste2018-06-151-0/+4
| | | | | | | | | | PR: 229046 MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13881 Notes: svn path=/head/; revision=335217
* Fix clang 6.0.0 compiler warnings in binutilsDimitry Andric2017-12-242-5/+5
| | | | | | | | | | | | | | | | | | | | 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
* The function make_relative_prefix_1 does not properly free locallyStephen J. Kiernan2017-12-061-4/+17
| | | | | | | | | | | | | | | | | allocated memory when it returns early. Free the memory associated with the variables full_programe, bin_dirs, prog_dirs, and prefix_dirs when the function returns early. Submitted by: Tom Rix <trix@juniper.net> Reviewed by: jhibbits, emaste Approved by: sjg (mentor) Obtained from: Juniper Networks, Inc. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D9691 Notes: svn path=/head/; revision=326636
* 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
* gnu binutils: FSGSBASE assembly/disassemblyRyan Libby2017-09-054-16/+57
| | | | | | | | | | | | | | | | | Enable the in-tree binutils to assemble and disassemble amd64 FSGSBASE instructions (rdfsbase, rdgsbase, wrfsbase, wrgsbase), used in the base system since r322763. This gives one last gasp for in-tree gcc, and provides a small enhancement for in-tree binutils objdump. Reviewed by: dim, kib Approved by: markj (mentor) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12222 Notes: svn path=/head/; revision=323192
* gas: add parens to clarify expression and eliminate clang warningEd Maste2017-08-181-1/+1
| | | | | | | | Building mips64 w/ Clang failed with -Werror,-Wshift-negative-value error: shifting a negative signed value is undefined Notes: svn path=/head/; revision=322675
* gas: fix "format string is not a string literal" errors on mipsEd Maste2017-08-181-2/+2
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=322671
* 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
* Align text correctly by using tabs instead of spaces.Pedro F. Giffuni2017-05-271-2/+2
| | | | | | | | The text was copy-pasted from the lines that carry the bogus spaces. This is a non-functional change. Notes: svn path=/head/; revision=319000
* Bring some rough support for FreeBSD S/390 to the GNU toolchain.Pedro F. Giffuni2017-05-234-2/+15
| | | | | | | | | | | | 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
* Fix parsing of 'vmov Q<n>.F32,Q<n>.F32' instruction.Michal Meloun2017-05-101-8/+8
| | | | | | | | | | | | | | parse_qfloat_immediate() accidentaly parses register with size qualifier as immediate constant (It takes '<n>.' substring as valid floating point constant). Due to this, slightly reorder cases in parse_neon_mov() and move parsing of vmov with immediate constant to last place. MFC after: 2 weeks Notes: svn path=/head/; revision=318135
* use INT3 instead of NOP for x86 binary paddingEd Maste2017-03-192-2/+2
| | | | | | | | | | | | | | | | | We should never end up executing the inter-function padding, so we are better off faulting than silently carrying on to whatever function happens to be next. Note that LLD will soon do this by default (although it currently pads with zeros). Reviewed by: dim, kib MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D10047 Notes: svn path=/head/; revision=315522
* Add rfdi opcode to binutilsJustin Hibbits2017-02-011-0/+1
| | | | | | | | | | | | The rfdi instruction is part of the e500mc and derivative cores. It came into binutils in a GPLv3 patch, along with the rest of the e500mc instruction set. Currently only rfdi is planned to be used, so rather than attempt to backport the full patch, take a surgical route and add instructions as needed. MFC after: 2 weeks Notes: svn path=/head/; revision=313035
* add octeon+ as an alias for octeon in GCC & binutilsEd Maste2017-01-271-0/+1
| | | | | | | | | | | | | | | | | | | | In r208737 jmallett@ added support for the "mips64r2" architecture and "octeon" CPU, and the saa/saad instructions. Upstream binutils also added the "octeon+" CPU, and the saa/saad instructions are only available in octeon+, not octeon. Since our base system tool chain already accepts saa/saad with -march=octeon, just allow octeon+ as an alias. This allows the use of octeon+ in kernel config files, for use with both external tool chain and in-tree GCC/binutils. PR: 216516 MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=312899
* 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
* Replace local prototype of basename() with an inclusion of <libgen.h>.Ed Schouten2016-05-291-1/+1
| | | | | | | | | | | | | | | | | | | | libiberty currently defines the prototype for basename() itself instead of using <libgen.h>. It still uses the BSD-style prototype instead of the POSIX one, meaning that if FreeBSD would switch over to the POSIX one, you wouldn't be able to use libiberty.h and libgen.h in a single source file. It turns out that kgdb does this. Patch up libiberty to just include <libgen.h>. I'm currently talking to upstream to see whether we can come up with a more complete solution that could be integrated, but for our unmaintained copy of GDB in base, let's just apply the simplest workaround possible. Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D6631 Notes: svn path=/head/; revision=300960
* gas: Implement the .inst assembler directive for arm.Pedro F. Giffuni2016-05-201-0/+32
| | | | | | | | | | | We normally use the binutils from ports but on other systems this is required for building gcc 4.9. Obtained from: OpenBSD (CVS rev. 1.5) MFC after: 3 weeks Notes: svn path=/head/; revision=300333
* gas/config/tc-arm.c: Minor re-sorting to match upstream history.Pedro F. Giffuni2016-05-201-2/+2
| | | | | | | | | No functional change. MFC after: 2 weeks Notes: svn path=/head/; revision=300304
* 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
* In binutils' arm-dis.c, avoid left-shifting a negative number.Dimitry Andric2015-09-221-1/+1
| | | | | | | | | Submitted by: dan.mcgregor_usask.ca (Dan McGregor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D3376 Notes: svn path=/head/; revision=288099
* In GNU as, avoid left-shifting negative integers, which is undefined.Dimitry Andric2015-08-091-2/+2
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=286519
* 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-033-3/+11
| | | | | | | | | | | | | | | | | 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
* Remove pregenerated text version of the texinfo documentationBaptiste Daroussin2015-03-022-20488/+0
| | | | Notes: svn path=/head/; revision=279530
* Generate manpage out of the texinfo files using texi2mdocBaptiste Daroussin2015-03-024-0/+22381
| | | | Notes: svn path=/head/; revision=279528
* 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 some opcodes for assembling forthcoming VSX (Vector-Scalar eXtension)Nathan Whitehorn2015-02-221-0/+5
| | | | | | | | support in the kernel. Userspace programs are expected to rely on LLVM's integrated assembler or newer binutils. Notes: svn path=/head/; revision=279187
* Fix ldscripts such that ld(1) collects the .fini_array section in the sameTijl Coosemans2015-02-111-1/+1
| | | | | | | | | | | | | order as the .init_array section. Finalisation routines need to be called in the opposite order as their corresponding initialisation routines but rtld(1) handles that by calling the function pointers in .fini_array in reverse order. Reviewed by: kib MFC after: 2 weeks Notes: svn path=/head/; revision=278586
* Add pregenerated documentation for as(1) and ld(1)Baptiste Daroussin2015-01-045-0/+20604
| | | | Notes: svn path=/head/; revision=276651