diff options
author | Jozef Lawrynowicz <jozef.l@mittosystems.com> | 2018-09-11 22:56:36 +0100 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-09-24 06:20:17 -0600 |
commit | db72737006fc383cb8838bf7f3dc8e641e60c38f (patch) | |
tree | 1c81ecc66318cd2e3e8cb8da3ae04e9855b5c945 /binutils/elfedit.c | |
parent | b5a9bfbebec0a42d3c5b4fe3b7a62bd31cecc440 (diff) | |
download | binutils-db72737006fc383cb8838bf7f3dc8e641e60c38f.zip binutils-db72737006fc383cb8838bf7f3dc8e641e60c38f.tar.gz binutils-db72737006fc383cb8838bf7f3dc8e641e60c38f.tar.bz2 |
Fix PR gdb/20948: --write option to GDB causes segmentation fault
When opening a BFD for update, as gdb --write does, modifications to
anything but the contents of sections is restricted.
Do not try to write back any ELF headers in this case.
bfd/ChangeLog
2018-09-24 Jozef Lawrynowicz <jozef.l@mittosystems.com>
PR gdb/20948
* elf.c (_bfd_elf_write_object_contents): Return from function
early if abfd->direction == both_direction.
gdb/testsuite/ChangeLog
2018-09-24 Jozef Lawrynowicz <jozef.l@mittosystems.com>
PR gdb/20948
* gdb.base/write_mem.exp: New test.
* gdb.base/write_mem.c: Likewise.
Diffstat (limited to 'binutils/elfedit.c')
0 files changed, 0 insertions, 0 deletions