Commit Graph

100120 Commits

Author SHA1 Message Date
Alan Modra 030a2e78ac ubsan: z8k: index 10 out of bounds for type 'unsigned int const[10]'
The fix is the additional ARRAY_SIZE test, the rest just tidies
variable types rather than adding a cast to avoid warnings.

opcodes/
	* z8k-dis.c: Include libiberty.h
	(instr_data_s): Make max_fetched unsigned.
	(z8k_lookup_instr): Make nibl_index and tabl_index unsigned.
	Don't exceed byte_info bounds.
	(output_instr): Make num_bytes unsigned.
	(unpack_instr): Likewise for nibl_count and loop.
	* z8kgen.c (gas <opcode_entry_type>): Make noperands, length and
	idx unsigned.
	* z8k-opc.h: Regenerate.
gas/
	* config/tc-z8k.c (md_begin): Make idx unsigned.
	(get_specific): Likewise for this_index.
2020-01-08 21:51:32 +10:30
Alan Modra 4c6ee6465a PR25351 .ARM.attributes not found for symbol
PR 25351
	* elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
	after removing sections.
2020-01-08 21:21:17 +10:30
GDB Administrator 27eea7ff8e Automatic date update in version.in 2020-01-08 00:00:28 +00:00
Tom Tromey 4212d50914 Add constructor to stap_static_probe_ops
PR build/24937 concerns an error given by the clang provided by a
particular version of macOS.  In particular, it reports

    error: default initialization of an object of const type 'const
    stap_static_probe_ops' without a user-provided default constructor

Although (at least according to sources I found online) this was
resolved as a bug in the standard, it seemed simple enough to work
around this.

Given that this is a trivial build fix, I think it should go on the
gdb 9 branch as well.

gdb/ChangeLog
2020-01-07  Tom Tromey  <tromey@adacore.com>

	PR build/24937:
	* stap-probe.c (class stap_static_probe_ops): Add constructor.

Change-Id: I18f180c17850f420e9b66afc67f9cb3d8dceb0b3
2020-01-07 09:16:29 -07:00
Jon Turney 06a6207a1a
Enable styling by default on Cygwin
Cygwin meets the expectations of gdb for styling (if TERM is set and not
'DUMB', the terminal supports 'ANSI' (ECMA-48) escape sequences.

gdb/ChangeLog:

2020-01-02  Jon Turney  <jon.turney@dronecode.org.uk>

	* cli/cli-style.c: Set cli_styling to 'true' in the Cygwin build.
2020-01-07 13:45:01 +00:00
Claudiu Zissulescu 2a1ebfb221 [ARC] Improve parsing instruction operands.
We use gas' expression function to parse the operands of an
instruction in a generic way. There are situations when we have labels
and registers having the same name as well as the substraction sign
doesn't always stands for the arithmetical operation but for the
register range (e.g. enter instruction). This patch improves parsing
symbols found in a instruction operand, cleans up code and avoids
using default or undefined variables.

gas/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/tc-arc.c (parse_reloc_symbol): New function.
	(tokenize_arguments): Clean up, use parse_reloc_symbol function.
	(md_operand): Set X_md to absent.
	(arc_parse_name): Check for X_md.
2020-01-07 15:29:31 +02:00
Shahab Vahedi bb82aefe17 [ARC] Add finer details for LLOCK and SCOND
This patch changes the "class" of LLOCK/SCOND from "MEMORY" to
"LLOCK/SCOND" respectively. Moreover, it corrects the "data_size_mode".

These changes are necessary for GDB's atmoic sequence handler.

Signed-off-by: Shahab Vahedi <shahab@synopsys.com>
2020-01-07 15:25:34 +02:00
GDB Administrator ef95444455 Automatic date update in version.in 2020-01-07 00:00:19 +00:00
Jim Wilson 85f7836470 RISC-V: Fix weak function call reloc overflow on llvm build.
bfd/
	PR 25205
	* elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
	check for !bfd_link_pic (info).
	<R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
	<R_RISCV_JAL>: Add comment.
	(_bfd_riscv_relax_section): For plt.offset check, add check for
	bfd_link_pic (info).  Add comment.

Change-Id: Ie769bc3d5adf096a51df5cc12efe3d50e80acb8f
2020-01-06 15:34:50 -08:00
Alan Modra 85e290dc12 Re: Prefer object over notype symbols when disassembling
Reverts unnecessary mips testsuite changes made by commit 660df28acf.

	* testsuite/ld-mips-elf/eh-frame5.s,
	* testsuite/ld-mips-elf/ehdr_start-new.s,
	* testsuite/ld-mips-elf/ehdr_start-o32.s,
	* testsuite/ld-mips-elf/mips16-call-global-1.s,
	* testsuite/ld-mips-elf/mips16-intermix-1.s,
	* testsuite/ld-mips-elf/mips16-pic-1b.s,
	* testsuite/ld-mips-elf/mips16-pic-4c.s,
	* testsuite/ld-mips-elf/no-shared-1-n64.s,
	* testsuite/ld-mips-elf/no-shared-1-o32.s,
	* testsuite/ld-mips-elf/pic-and-nonpic-1b-micromips.s,
	* testsuite/ld-mips-elf/pic-and-nonpic-1b.s,
	* testsuite/ld-mips-elf/pic-and-nonpic-2a.s,
	* testsuite/ld-mips-elf/pic-and-nonpic-3b.s,
	* testsuite/ld-mips-elf/pic-and-nonpic-4b.s,
	* testsuite/ld-mips-elf/pic-and-nonpic-5a.s,
	* testsuite/ld-mips-elf/pic-and-nonpic-6-n32c.s,
	* testsuite/ld-mips-elf/pic-and-nonpic-6-n64c.s,
	* testsuite/ld-mips-elf/pic-and-nonpic-6-o32c.s,
	* testsuite/ld-mips-elf/pie.s,
	* testsuite/ld-mips-elf/relax-jalr.s: Revert 2019-12-17 change.
2020-01-07 09:34:52 +10:30
Andrew Burgess 153d79c451 gdb: Fix backtrace with disassemble-next-line on
In this commit:

  commit ec8e2b6d30
  Date:   Fri Jun 14 23:43:00 2019 +0100

      gdb: Don't allow annotations to influence what else GDB prints

A change was accidentally made that moved a call to do_gdb_disassembly
out of an if block guarded by 'if (source_print && sal.symtab)'.  The
result was that if a user has 'set disassemble-next-line on' then the
backtrace would now include some disassembly of a few instructions in
each frame.

This change was not intentional, but was not spotted by any tests.

This commit restores the old behaviour and adds a test to ensure this
doesn't break again in the future.

gdb/ChangeLog:

	* stack.c (print_frame_info): Move disassemble_next_line code
	inside source_print block.

gdb/testsuite/ChangeLog:

	* gdb.base/backtrace.c: New file.
	* gdb.base/backtrace.exp: New file.

Change-Id: I47c52a202fa74be138382646b695827940178689
2020-01-06 21:16:28 +00:00
Eli Zaretskii 66182876b4 Fix MinGW native compilation of gdb/gdbsupport/gdb_wait.c
gdb/ChangeLog
2020-01-06  Eli Zaretskii  <eliz@gnu.org>

	* gdbsupport/gdb_wait.c: Include <signal.h> instead of
	gdb/signals.h, as we are now using native signal symbols.
2020-01-06 21:54:21 +02:00
Shahab Vahedi cbfa858117 GDB: Fix the overflow in addr/line_is_displayed()
In tui_disasm_window::addr_is_displayed(), there can be situations
where "content" is empty. For instance, it can happen when the
"content" was not filled in tui_disasm_window::set_contents(),
because tui_disassemble() threw an exception. Usually this exception
is the result of fetching invalid PC addresses like the ones beyond
the end of the program.

Having "content.size ()" zero leads to an overflow in this condition
check inside tui_disasm_window::addr_is_displayed():

  int i = 0;
  while (i < content.size () - threshold ...) {
    ... content[i] ...
  }

"threshold" is 2 and there are times that "content.size ()" is 0.
This results into an overflow and the loop is entered whereas it
should have been skipped. Finally, "content[i]" access leads to
a segmentation fault.

Same problem applies to tui_source_window::line_is_displayed().

The issue has been discussed at length in bug 25345:
  https://sourceware.org/bugzilla/show_bug.cgi?id=25345

This commit avoids the segmentation faults with an early check:

  if (content.size () < SCROLL_THRESHOLD)
    return false;

Moreover, those functions have been overhauled to a leaner code.

gdb/ChangeLog:
2020-01-06  Shahab Vahedi  <shahab@synopsys.com>

	* tui/tui-disasm.c (tui_disasm_window::addr_is_displayed): Avoid
	overflow by an early check of content vs threshold.
        * tui/tui-source.c (tui_source_window::line_is_displayed):
	Likewise.
2020-01-06 19:47:20 +00:00
Eli Zaretskii 3f6028216b Mention the recent fix of $_exitsignal on MS-Windows in gdb/NEWS
gdb/ChangeLog
2020-01-06  Eli Zaretskii  <eliz@gnu.org>

	* NEWS: Mention the recent fix of $_exitsignal on MS-Windows.
2020-01-06 21:25:23 +02:00
Jon Turney a08c904d4e
Fix a crash with a malformed PE header
Don't try to read the PE export table when no section contains the RVA
for it.

(I have a PE executable [1] packed with UPX, where the export table data
directory entry contains a RVA which doesn't correspond to any section.
Mistakenly trying to debug this with gdb makes it crash.)

[1] https://cygwin.com/setup/setup-2.898.x86_64.exe

gdb/ChangeLog:

2020-01-02  Jon Turney  <jon.turney@dronecode.org.uk>

	* coff-pe-read.c (read_pe_exported_syms): Don't try to read the
	export table if no section contains it's RVA.
2020-01-06 18:30:44 +00:00
Eli Zaretskii 89a65580f4 Fix a typo in gdb/windows-tdep.c
gdb/ChangeLog
2020-01-06  Eli Zaretskii  <eliz@gnu.org>

	    * windows-tdep.c: Fix a typo in WINDOWS_SIGABRT.
2020-01-06 20:22:15 +02:00
Nick Clifton 0e1f1593bc Add -fcommon compiler command line option to linker tests that need common symbols.
PR 25327
	* testsuite/ld-elf/shared.exp: Add -fcommon option to compiler
	command line when building libcomm1.o and pr13250 tests.
	* testsuite/ld-plugin/lto.exp: Likewise for pr20267 tests.
2020-01-06 16:24:23 +00:00
Hannes Domani 8b7fcda274 Fix search in TUI
The variable last_line_listed is never set when print_source_lines_base is
called in TUI mode, so the search always started from the last line printed
outside of TUI mode.

gdb/ChangeLog:

2020-01-06  Hannes Domani  <ssbssa@yahoo.de>

	* source.c (print_source_lines_base): Set last_line_listed.
2020-01-06 17:14:13 +01:00
Nick Clifton d2dbcb18c6 Fix test of the fix for PR19579 when compiling with gcc-10.
PR 25326
	* testsuite/ld-elf/shared.exp: Add -fcommon option to compiler
	command line when building pr19579 binaries.
2020-01-06 14:01:41 +00:00
Shahab Vahedi a61b4f6997 GDB: Remove trailing spaces in tui-disasm.c
A few trailing spaces are removed.

gdb/ChangeLog:
2020-01-06  Shahab Vahedi  <shahab@synopsys.com>

	* tui/tui-disasm.c: Remove trailing spaces.
2020-01-06 13:43:46 +00:00
Eli Zaretskii 559e7e5056 Improve process exit status macros on MinGW
When a Windows program is terminated by a fatal exception, its exit
code is the value of that exception, as defined by the various
EXCEPTION_* symbols in the Windows API headers.  This commit emulates
WTERMSIG etc. by translating the fatal exception codes to more-or-less
equivalent Posix signals.

gdb/ChangeLog:
2020-01-06  Eli Zaretskii  <eliz@gnu.org>
	    Pedro Alves  <palves@redhat.com>

	* Makefile.in (COMMON_SFILES): Add gdbsupport/gdb_wait.c.
	* windows-tdep.c: New enumeration of WINDOWS_SIG* signals.
	(windows_gdb_signal_to_target): New function, uses the above
	enumeration to convert GDB internal signal codes to equivalent
	Windows codes.
	(windows_init_abi): Call set_gdbarch_gdb_signal_to_target.
	* windows-nat.c: Include "gdb_wait.h".
	(get_windows_debug_event): Extract the fatal exception from the
	exit status and convert to the equivalent Posix signal number.
	* cli/cli-cmds.c (exit_status_set_internal_vars): Account for the
	possibility that WTERMSIG returns GDB_SIGNAL_UNKNOWN.
	* gdbsupport/gdb_wait.c: New file, implements
	windows_status_to_termsig.
	* gdbsupport/gdb_wait.h (WIFEXITED, WIFSIGNALED, WEXITSTATUS)
	(WTERMSIG) [__MINGW32__]: Separate definitions for MinGW.

gdb/gdbserver/ChangeLog:
2020-01-06  Eli Zaretskii  <eliz@gnu.org>
	    Pedro Alves  <palves@redhat.com>

	* win32-low.c (get_child_debug_event): Extract the fatal exception
	from the exit status and convert to the equivalent Posix signal
	number.
	(win32_wait): Allow TARGET_WAITKIND_SIGNALLED status as well.
	* Makefile.in (OBS, SFILES): Add gdb_wait.[co].
2020-01-06 11:51:54 +00:00
Alan Modra 49078ece04 bfd_check_format: ignore errors from coff_real_object_p
Since 1993-11-05 git commit c188b0bec3, bfd_check_format has failed
if any of the target object_p functions returns false with any error
but bfd_error_wrong_format.  That's just weird.  There is really no
reason why coff_real_object_p should be fixed to only return that
error instead of numerous other possible errors.  Even an out of
memory condition for one target doesn't necessarily mean other targets
can't match, assuming the failing target nicely returns all memory it
might have used.

	* format.c (bfd_check_format_matches): Ignore bfd_error on target
	match failures.  Don't init to bfd_error_wrong_format before
	calling _bfd_check_format.
2020-01-06 21:53:51 +10:30
Alan Modra ab356be74c alpha-vms: don't exit on stack underflow/overflow
BFD is not supposed to exit or abort on anything the user can do.

	* vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
	status rather than exiting on stack overflow or underflow.
	(_bfd_vms_slurp_etir): Adjust to suit.
2020-01-06 21:53:51 +10:30
Alan Modra cc6aa1a6e0 ubsan: m32c: left shift of negative value
There are probably a lot more of these still here.

cpu/
	* m32c.cpu (f-dsp-8-u16, f-dsp-8-s16): Rearrange to mask any sign
	bits before shifting rather than masking after shifting.
	(f-dsp-16-u16, f-dsp-16-s16, f-dsp-32-u16, f-dsp-32-s16): Likewise.
	(f-dsp-40-u16, f-dsp-40-s16, f-dsp-48-u16, f-dsp-48-s16): Likewise.
	(f-dsp-64-u16, f-dsp-8-s24): Likewise.
	(f-bitbase32-16-s19-unprefixed): Avoid signed left shift.
opcodes/
	* m32c-ibld.c: Regenerate.
2020-01-06 21:53:51 +10:30
Alan Modra 85d8681747 som_bfd_fill_in_ar_symbols buffer overflow
* som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
2020-01-06 21:53:51 +10:30
Alan Modra 3e6aa7751a Basic error checking for mach-o
Fixes lots of places the fuzzers are going to find, and the one they
already hit.

	* mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
	command.  Check name offset is within command.
	(bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
	(bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
	(bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
	(bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
	(bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
	(bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
	(bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
	(bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
	(bfd_mach_o_read_note, bfd_mach_o_read_build_version),
	(bfd_mach_o_read_segment): Similarly.
	(bfd_mach_o_read_thread): Properly bound check thread struct.
	Don't repeat checks on second loop.
	(bfd_mach_o_read_command): Fail on invalid command length.
2020-01-06 21:53:51 +10:30
Alan Modra 660e62b1d9 PR25344, z80 disassembler recursion
PR 25344
	* z80-dis.c (suffix): Don't use a local struct buffer copy.
	Peek at next byte to prevent recursion on repeated prefix bytes.
	Ensure uninitialised "mybuf" is not accessed.
	(print_insn_z80): Don't zero n_fetch and n_used here,..
	(print_insn_z80_buf): ..do it here instead.
2020-01-06 21:53:16 +10:30
GDB Administrator 01335edbac Automatic date update in version.in 2020-01-06 00:00:21 +00:00
Andrew Burgess f2302a34f2 gdb: use tui_set_layout not show_layout to fix window focus
When calling tui_add_win_to_layout, use tui_set_layout not show_layout
so that window focus is correctly updated.  If the focus is not
correctly maintained then GDB can be crashed like this:

  start
  tui enable
  layout asm
  list SOME_FUNCTION

At this point GDB will have "popped up" the source window to
display SOME_FUNCTION.  Previously no window would have focus at this
point, and so if the user now does 'focus next' or 'focus prev', then
GDB would crash.

Calling tui_set_layout ensures that focus is correctly calculated as
the source window is "popped up", and this fixes the issue.

gdb/ChangeLog:

	* tui/tui-layout.c (tui_add_win_to_layout): Use tui_set_layout not
	show_layout.

gdb/testsuite/ChangeLog:

	* gdb.tui/list.exp: Test 'focus next' after 'list main'.

Change-Id: Id0b13f99b0e889261efedfd0adabe82020202f44
2020-01-05 21:49:05 +00:00
Luis Machado 6a5206eb27 [AArch64] Fix erroneous use of spu architecture bfd
While investigating some SVE code, i noticed the use of two spu bfd variables.

This looks like an oversight, as the "id" field is available for non-spu
architectures as well, even though its primary use was the Cell BE
architecture.

gdb/ChangeLog:

2020-01-05  Luis Machado  <luis.machado@linaro.org>

	* aarch64-linux-nat.c
	(aarch64_linux_nat_target::thread_architecture): Use bfd_arch_aarch64
	and bfd_mach_aarch64.
2020-01-05 08:57:34 -03:00
Joel Brobecker eb9a7e353f Fix libctf ChangeLog date in most recent entry. 2020-01-05 09:53:14 +04:00
Eli Zaretskii 3a657c600b libctf: Add configure check for asprintf (for MinGW)
This commit fixes a compilation warning when compiling libctf
on MinGW:

    libctf/ctf-dump.c:118:8: warning: implicit declaration of function
    'asprintf'; did you mean 'vasprintf'? [-Wimplicit-function-declaration]

	 if (asprintf (&bit, " %lx: [slice 0x%x:0x%x]",
	     ^~~~~~~~
	     vasprintf

MinGW doesn't provide that function, so we depend on the one provided
by libiberty. However, the declaration is guarded by HAVE_DECL_ASPRINTF,
which we do not have in libctf's config.h.

libctf/ChangeLog:

	PR binutils/25155:
	* configure.ac: Add AC_CHECK_DECLS([asprintf]).
	* configure, config.h.in: Regenerate.
2020-01-05 09:50:27 +04:00
GDB Administrator 7fddfece82 Automatic date update in version.in 2020-01-05 00:01:08 +00:00
Alan Modra ea933f17c3 Release bfd_alloc memory in bfd_check_format_matches
It's a little tricky.  We can release any memory back when we have a
match failure, but after a match success which we might want to
preserve for later use the high water mark must change to that of the
matched bfd.

	* format.c (bfd_check_format_matches): Add preserve_match.
	Save initial bfd state in "preserve", matched bfd state in
	"preserve_match".  Save just the first match.  Release
	bfd_alloc memory.  Restore and finish preserved state as
	appropriate on all function exit paths.
2020-01-04 19:20:33 +10:30
Alan Modra f24bdec486 mmo tdata leak
malloc'd tdata isn't freed.

	* mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
2020-01-04 19:20:33 +10:30
Alan Modra c9ae58fe32 ubsan: m32r: left shift of negative value
cpu/
	* m32r.cpu (f-disp8): Avoid left shift of negative values.
	(f-disp16, f-disp24): Likewise.
opcodes/
	* m32r-ibld.c: Regenerate.
2020-01-04 19:20:33 +10:30
Alan Modra 5f57d4ecf5 ubsan: cr16: left shift cannot be represented in type 'int'
* cr16-dis.c (cr16_match_opcode): Avoid shift left of signed value.
2020-01-04 19:20:33 +10:30
Alan Modra 2c5c119630 ubsan: crx: left shift cannot be represented in type 'int'
* crx-dis.c (match_opcode): Avoid shift left of signed value.
2020-01-04 19:20:33 +10:30
Alan Modra 2e98c6c5c5 ubsan: d30v: left shift cannot be represented in type 'int'
* d30v-dis.c (print_insn): Avoid signed overflow in left shift.
2020-01-04 19:20:33 +10:30
Alan Modra 991fb595e3 coff: free malloc'd memory on successful target match too
object_p functions cannot allocate memory by malloc and not free it
before returning.  Even a successful target match may not be the best
match.  If a match isn't used then those malloc'd blocks won't be
freed.

	* coffgen.c (coff_real_object_p): Free malloc'd memory on target
	match too.
2020-01-04 18:53:07 +10:30
GDB Administrator 5ffd5873e6 Automatic date update in version.in 2020-01-04 00:00:16 +00:00
Philippe Waroquiers 6ec1d75e05 Ensure GDB warnings are styled.
While handling the comments of Tom related to
  [RFC] Have an option to tell GDB to detect and possibly handle mismatched exec-files.
  https://sourceware.org/ml/gdb-patches/2019-12/msg00621.html
I saw that GDB warnings are produced ignoring the given styles.

This patch:
  * ensures that style markups are properly handled by "warning".
  * changes 'set/show data-directory' so that file style is used
    in warnings and in 'show message'
  * changes all other messages in top.c to use file style when appropriate.
  * Uses the above data-directory changes in gdb.base/style.exp

2020-01-03  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

	* ui-file.c (stdio_file::can_emit_style_escape)
	(tee_file::can_emit_style_escape): Ensure style is used also on
	gdb_stderr when gdb_stderr is a tty supporting styling, similarly
	to gdb_stdout.
	* main.c (set_gdb_data_directory): Use file style to output the
	warning that the given pathname is not a directory.
	* top.c (show_history_filename, gdb_safe_append_history)
	(show_gdb_datadir): Use file style.

2020-01-03  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

	* gdb.base/style.exp: Test that warnings are styled.
2020-01-03 21:13:21 +01:00
Hannes Domani 44f81a7654 solib_target_free_so memory leak
gdb/ChangeLog:

2020-01-03  Hannes Domani  <ssbssa@yahoo.de>

	* solib-target.c (struct lm_info_target):
	Change offsets to be a unique_xmalloc_ptr.
	(solib_target_relocate_section_addresses): Update.
2020-01-03 17:58:19 +01:00
Hannes Domani 25057eb004 windows_clear_solib memory leak
gdb/ChangeLog:

2020-01-03  Hannes Domani  <ssbssa@yahoo.de>

	* windows-nat.c (windows_clear_solib): Free so_list linked list.
2020-01-03 17:57:03 +01:00
Sergey Belyashov 16d8767399 Allow individual targets to decide if string escapes should be allowed. Disable for PPC and Z80.
PR 25311
	* as.h (TC_STRING_ESCAPES): Provide a default definition.
	* app.c (do_scrub_chars): Use TC_STRING_ESCAPES instead of
	NO_STRING_ESCAPES.
	* read.c (next_char_of_string): Likewise.
	* config/tc-ppc.h (TC_STRING_ESCAPES): Define.
	* config/tc-z80.h (TC_STRING_ESCAPES): Define.
2020-01-03 16:23:19 +00:00
Nick Clifton f2a3559d54 Fix potential illegal memory access when parsing a corrupt PEF format file.
PR 25307
	(bfd_pef_parse_function_stubs): Correct the test that ensures that
	there is enough data remaining in the code buffer before
	attempting to read a function stub.
2020-01-03 16:17:53 +00:00
Nick Clifton 7a0fb7be96 Fix potential illegal memory access failures in the BFD library by ensuring that the return value from bfd_malloc() is checked before it is used.
PR 25308
	* elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
	return value from bfd_malloc.
	* elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
	(bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
	(elf32_arm_filter_cmse_symbols): Likewise.
	(elf32_arm_write_section): Likewise.
	* mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
	(bfd_mach_o_follow_dsym): Likewise.
	* pef.c (bfd_pef_print_loader_section): Likewise.
	(bfd_pef_scan_start_address): Likewise.
	(bfd_pef_parse_function_stubs): Likewise.
	(bfd_pef_parse_symbols): Likewise.
2020-01-03 14:41:02 +00:00
Nick Clifton a2322019f5 Updated Swedish translation for the GAS subdirectory. 2020-01-03 12:59:54 +00:00
Hannes Domani dc9bd8c92a For PE format files, the base relocation table is necessary if the image is loaded at a different image base than specified in the PE header. This patch provides a new option --enable-reloc-section to force the generation of this section.
* emultempl/pe.em: Add new option --enable-reloc-section.
	* emultempl/pep.em: Likewise.
	* ld.texi: Document --enable-reloc-section.
	* pe-dll.c (pe_dll_build_sections): Use pe_dll_enable_reloc_section.
	(pe_dll_fill_sections): Simplify by calling pe_exe_fill_sections.
	* pe-dll.h: Add extern declaration of option flag.
	* pep-dll.c (pe_dll_enable_reloc_section):
	Add alias define for pep_dll_enable_reloc_section.
	* pep-dll.h: Add extern declaration of option flag.
2020-01-03 12:57:15 +00:00
Sergei Trofimovich b26a3d5827 Fix ld/PR25316 for the ia64 target by refusing to support binary merging.
ld/PR25316
	* elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
        on binary inputs ld/PR25316.
        (is_ia64_elf): new helper to filter on ia64 objects.
2020-01-03 11:21:00 +00:00