aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-11-01macho-o archive sanity checksAlan Modra1-0/+11
Anti-fuzzing checks. * mach-o.c (bfd_mach_o_fat_archive_p): Sanity check entry offset and size against file size.
2021-11-01objcopy buffer overflowAlan Modra1-12/+9
"tocopy" in this code was an int, which when the size to be copied was larger than MAXINT could result in tocopy being negative. A negative value of course is less than BUFSIZE, but when converted to bfd_size_type is extremely large. PR 995 * objcopy.c (copy_unknown_object): Correct calculation of "tocopy". Use better variable types.
2021-11-01arm: add armv9-a architecture to -marchPrzemyslaw Wirkus14-26/+131
Update also include: + New value of Tag_CPU_arch EABI attribute (22) is added. + Updated missing Tag_CPU_arch EABI attributes. + Updated how we combine archs 'v4t_plus_v6_m' as this mechanism have to handle new Armv9 as well. Regression tested on `arm-none-eabi` cross Binutils and no issues. bfd/ * archures.c: Define bfd_mach_arm_9. * bfd-in2.h (bfd_mach_arm_9): Define bfd_mach_arm_9. * cpu-arm.c: Add 'armv9-a' option to -march. * elf32-arm.c (using_thumb2_bl): Update assert check. (arch_has_arm_nop): Add TAG_CPU_ARCH_V9. (bfd_arm_get_mach_from_attributes): Add case for TAG_CPU_ARCH_V9. Update assert. (tag_cpu_arch_combine): Updated table. (v9): New table.. binutils/ * readelf.c (arm_attr_tag_CPU_arch): Update with elfcpp/ * arm.h: Update TAG_CPU_ARCH_ enums with correct values. gas/ * NEWS: Update docs. * config/tc-arm.c (get_aeabi_cpu_arch_from_fset): Return Armv9-a for -amarch=all. (aeabi_set_public_attributes): Update assert. * doc/c-arm.texi: Update docs. * testsuite/gas/arm/armv9-a_arch.d: New test. * testsuite/gas/arm/attr-march-all.d: Update test with v9. include/ * elf/arm.h Update TAG_CPU_ARCH_ defines with correct values. * opcode/arm.h (ARM_EXT3_V9A): New macro. (ARM_ARCH_NONE): Updated with arm_feature_set.core size. (FPU_NONE): Updated. (ARM_ANY): Updated. (ARM_ARCH_UNKNOWN): New macro. (ARM_FEATURE_LOW): Updated. (ARM_FEATURE_CORE): Updated. (ARM_FEATURE_CORE_LOW): Updated. (ARM_FEATURE_CORE_HIGH): Updated. (ARM_FEATURE_COPROC): Updated. (ARM_FEATURE): Updated. (ARM_FEATURE_ALL): New macro. opcodes/ * arm-dis.c (select_arm_features): Support bfd_mach_arm_9. Also Update bfd_mach_arm_unknown to use new macro ARM_ARCH_UNKNOWN.
2021-11-01sim: iq2000: reduce -Wno-error scopeMike Frysinger2-5/+5
Clean up the warnings in sim-if, then reduce the -Werror disable to the files that still aren't clean that now that we require GNU make and can set variables on a per-object basis.
2021-11-01sim: lm32: reduce -Wno-error scopeMike Frysinger3-5/+5
Clean up some warnings in dv-lm32cpu, and all in sim-if, then reduce the -Werror disable to the files that still aren't clean that now that we require GNU make and can set variables on a per-object basis.
2021-11-01sim: frv: reduce -Wno-error scopeMike Frysinger1-2/+2
Only two files in here still generates warnings, so reduce the -Werror disable to that now that we require GNU make and can set variables on a per-object basis.
2021-11-01sim: m32r: reduce -Wno-error scopeMike Frysinger1-2/+2
Only two files in here still generates warnings, so reduce the -Werror disable to that now that we require GNU make and can set variables on a per-object basis.
2021-11-01sim: mips: reduce -Wno-error scopeMike Frysinger2-8/+8
Fix a few printf warnings in sim-main.c, and then we're left with only one file in here still generating warnings, so reduce the -Werror disable to that alone now that we require GNU make and can set variables on a per-object basis.
2021-11-01sim: erc32: reduce -Wno-error scopeMike Frysinger1-2/+2
Only one file in here still generates warnings, so reduce the -Werror disable to that alone now that we require GNU make and can set variables on a per-object basis.
2021-11-01sim: cris: reduce -Wno-error scopeMike Frysinger1-2/+2
Only two files in here still generates warnings, so reduce the -Werror disable to that now that we require GNU make and can set variables on a per-object basis.
2021-11-01sim: sh: reduce -Wno-error scopeMike Frysinger1-2/+2
Only one file in here still generates warnings, so reduce the -Werror disable to that alone now that we require GNU make and can set variables on a per-object basis.
2021-11-01sim: or1k: build with -WerrorMike Frysinger1-3/+0
The only warnings left in this port are a few maybe-uninitialized, but we don't abort the build for them, so turn on -Werror everywhere.
2021-11-01sim: igen: minor build output alignment fixMike Frysinger1-1/+1
The custom echo was off by one space relative to all the others.
2021-11-01sim: ppc: fix the printf fix for 32-bit systemsMike Frysinger1-1/+1
The time delta is a 64-bit value too.
2021-11-01sim: m68hc11: clean up pointer castsMike Frysinger1-3/+3
The void *data field is used to past arbitrary data between event handlers, and these are using it to pass an integer. Fix up the casts to avoid using (long) to cast to/from pointers since there is no guarantee that's the right size.
2021-11-01sim: d10v: clean up pointer castsMike Frysinger1-6/+6
Use %p to print pointers instead of trying to cast them to longs.
2021-10-31sim: bfin: cast pointers using uintptr_tMike Frysinger28-61/+61
We can't assume that sizeof(long) == sizeof(void*), so change all these casts over to uintptr_t.
2021-10-31sim: ppc: clean up printf format handlingMike Frysinger9-117/+116
Don't blindly cast every possible type to (long). Change to the right printf format specifier whether it be a 64-bit type or a pointer.
2021-10-31sim: ppc: switch core types to stdint.h typesMike Frysinger1-12/+11
There's no need to define these ourselves anymore, so switch to the stdint.h types. This will be important when we start using PRI* defines with printf formats.
2021-10-31sim: mn10300: clean up pointer castsMike Frysinger2-9/+9
The void *data field is used to past arbitrary data between event handlers, and these are using it to pass an enum. Fix up the casts to avoid using (long) to cast to/from pointers since there is no guarantee that's the right size.
2021-10-31sim: events: clean up trace castsMike Frysinger1-72/+83
Don't blindly cast every possible type to (long). Change to the right printf format specifier whether it be a 64-bit type or a pointer.
2021-10-31sim: ppc: handle \r in igen inputs [PR sim/28476]Mike Frysinger1-8/+16
Make sure we consume & ignore \r bytes in inputs in case the file encodings are from a non-LF systems (e.g. Windows).
2021-10-31sim: ppc: constify strings in igen toolingMike Frysinger13-50/+51
2021-11-01Automatic date update in version.inGDB Administrator1-1/+1
2021-10-31Fix latent bug in DWARF test caseTom Tromey1-2/+2
On my branch that replaces the DWARF psymtab reader, dw2-stack-boundary.exp started failing. However, when I look at the output in gdb.log, it is correct: file /home/tromey/gdb/build/gdb/testsuite/outputs/gdb.dwarf2/dw2-stack-boundary/dw2-stack-boundary Reading symbols from /home/tromey/gdb/build/gdb/testsuite/outputs/gdb.dwarf2/dw2-stack-boundary/dw2-stack-boundary... During symbol reading: location description stack overflow During symbol reading: location description stack underflow What happens to cause the failure is that the two branches in gdb_test_multiple appear in this order: -re "\r\nDuring symbol reading: location description stack underflow" { [...] -re "\r\nDuring symbol reading: location description stack overflow" { The first one will match the above, without causing the second one to ever match -- leading to a spurious failure. Anchoring the regexps seems to fix the problem, and works for the current gdb as well.
2021-10-31Fix unittest.exp failure due to 'set debuginfod' additionTom Tromey1-2/+2
The 'set debuginfod' change caused a regression in unittest.exp: Running selftest help_doc_invariants. help doc broken invariant: command 'info set debuginfod' help doc first line is not terminated with a '.' character help doc broken invariant: command 'set debuginfod' help doc first line is not terminated with a '.' character help doc broken invariant: command 'show debuginfod' help doc first line is not terminated with a '.' character Self test failed: self-test failed at ../../binutils-gdb/gdb/unittests/command-def-selftests.c:100 This patch fixes the problem. I'm checking it in.
2021-10-31sim: ppc: use silent build rules here tooMike Frysinger3-50/+50
The ppc codebase is unique and doesn't leverage common/, so have to add silent rules to it specifically.
2021-10-31sim: rl78: drop obsolete manual dependency rulesMike Frysinger1-15/+0
We have GNU make generate these for us automatically now, so there's no need to manually specify any deps.
2021-10-31sim: drop unused targ-vals.h includesMike Frysinger6-7/+0
This is used in a few places where it's not needed. Drop the include to avoid the build-time generated header file as we move to drop it.
2021-10-31sim: unify callback.o buildingMike Frysinger3-1/+22
Now that the use of TARGET_xxx defines have been removed, we can move this to the common logic so we only build it once for multi-targets.
2021-10-31sim: nltvals: pull target open flags out into a dedicated source fileMike Frysinger6-45/+106
Like we just did for pulling out the errno & signal maps, pull out the open flag map into a dedicated common file. All newlib ports are using the same map which makes it easy.
2021-10-31sim: nltvals: localize TARGET_<open> definesMike Frysinger3-25/+40
Code should not be using these directly, instead they should be resolving these dynamically via the open_map. Rework the common callback code that was using the defines to use symbolic names instead, and localize some of the defines in the ARM code (since it's a bit unclear how many different APIs it supports currently), then remove the defines out of the header so no new code can rely on them.
2021-10-31sim: nltvals: pull target signal out into a dedicated source fileMike Frysinger6-65/+157
Like we just did for pulling out the errno map, pull out the signal map into a dedicated common file. All newlib ports are using the same signal map which makes it easy.
2021-10-31sim: nltvals: pull target errno out into a dedicated source fileMike Frysinger7-147/+384
The current system maintains a list of target errno constants in the nltvals.def file, then runs a build-time tool to turn that into a C file. This list of errno values is the same for all arches, so we don't need the arch-specific flexibility. Further, these are only for newlib/libgloss environments, which makes it confusing to support other userland runtimes (like Linux). Let's simplify to make this easier to understand & build. We don't namespace the variables yet, but sets up the framework for it. Create a new target-newlib-errno.c template file. The template file is hand written, but the inline map is still automatically generated. This allows us to move it to the common set of objects so it's only built once in a multi-target build. Now we can remove the output from the gentmap build-time tool since it's checked into the tree. Then we stop including the errno lists in nltvals.def since nothing uses it.
2021-10-31sim: erc32: use silent build rules with sis linkageMike Frysinger1-1/+1
2021-10-31sim: erc32: fix a few more build warningsMike Frysinger1-5/+8
Tweak the if indentation & brace style to avoid ambiguous warnings. Add ATTRIBUTE_UNUSED to UART functions that aren't used when FAST_UART is defined (which is the default).
2021-10-31sim: erc32: fix signedness compatibility and redefinition warningsOrgad Shaneh4-25/+27
2021-10-31sim: add arch-specific conditional logicMike Frysinger2-33/+532
This will make it easy to include arch-specific logic (build files) as we migrate ports to the common top level build.
2021-10-31sim: v850: delete old gencode logicMike Frysinger1-7/+2
The v850 port used to have a gencode helper, but it was deleted long ago. Clean up the settings that no longer make sense w/out it.
2021-10-31sim: common: merge multiple clean commandsMike Frysinger1-6/+6
This provides a minor speedup when cleaning in a multi-target build.
2021-10-31sim: m32c: tighten up opc2c build outputMike Frysinger2-7/+6
Drop the single debugging line that repeats the command line option, and use the silent build helpers to tighten up output.
2021-10-31sim: tighten up build regen rulesMike Frysinger1-4/+4
Update the makefile & configure related rules to use the silent build helpers.
2021-10-31sim: tighten up gencode outputMike Frysinger4-19/+19
Update the gencode rules to use the silent build helpers.
2021-10-31sim: igen: tighten up build outputMike Frysinger5-11/+14
Add a new stamp helper for quiet builds, and don't dump the command line options when it runs. That isn't standard tool behavior, and doesn't really seem necessary in any way.
2021-10-31sim: tighten up stamp rulesMike Frysinger8-31/+46
Add a new ECHO_STAMP helper and convert existing stamp code over to it. This is mostly common rules and cgen mloop rules.
2021-10-31sim: silence stamp touch rulesMike Frysinger12-48/+48
We pretty much never care about these stamp touches, so silence them. Also switch to using $@ when it makes sense.
2021-10-31sim: standardize move-if-change rulesMike Frysinger12-188/+158
Use the srcroot path and make them all silent.
2021-10-31sim: mips/v850: remove redundant variable setupMike Frysinger2-7/+0
The common/Make-common.in fragment already provides these variables.
2021-10-30sim: fix compilation on mingw64 [PR sim/28476]Orgad Shaneh4-10/+16
...by reordering includes. 1. sim-utils.c sim/mips/sim-main.h defines UserMode, while there is a struct in winnt.h which has UserMode as a member. So if sim-main.h is included before winnt.h, compilation fails. 2. ppc registers.h defines CR, which is used as a member in winnt.h. winsock2.h is included by sys/time.h, so sys/time.h has to be included before registers.h. Bug: https://sourceware.org/PR28476
2021-10-31Don't include coff/pe.h in coff-x86_64.cAlan Modra2-5/+5
This (and other) code from coffcode.h is broken for x86_64_coff_vec, and has been ever since support was added in 2006 commit 99ad839030c1 Here, bfd_coff_aoutsz must match coff_swap_aouthdr_out otherwise we end up writing garbage. /* Note that peicode.h fills in a PEAOUTHDR, not an AOUTHDR. include/coff/pe.h sets AOUTSZ == sizeof (PEAOUTHDR)). */ char * buff; bfd_size_type amount = bfd_coff_aoutsz (abfd); buff = (char *) bfd_malloc (amount); if (buff == NULL) return false; coff_swap_aouthdr_out (abfd, & internal_a, buff); amount = bfd_bwrite (buff, amount, abfd); We have removed support for --target=x86_64-coff, likely because it never worked properly, but still produce coff-x86_64.o with --enable-targets=all. This means objcopy can recognize x86_64 COFF files but will write garbage to the output file, a fact found by fuzzers. I suspect x86_64 COFF is still broken after this fix, and mention of coff-x86_64.* should be removed from bfd/Makefile.am. * coff-x86_64.c: Don't include coff/pe.h. (COFF_WITH_pex64): Don't define here. * pe-x86_64.c: Include coff/pe.h and other headers. (PEI_HEADERS): Define.