From: Senthil Kumar Selvaraj Date: Wed, 30 Mar 2016 13:52:26 +0000 (+0100) Subject: Fix a seg-fault in the AVR linker. X-Git-Tag: users/hjl/linux/release/2.26.51.0.2~1^2~70^2~64 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=024ea11b48d2270cd0b3b2b6fbe9e42c9fd232e0;p=thirdparty%2Fbinutils-gdb.git Fix a seg-fault in the AVR linker. * elf32-avr.c (avr_elf32_load_records_from_section): Free internal_relocs only if they aren't cached. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 7cf79bb1460..b1b053b43a4 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2016-03-30 Senthil Kumar Selvaraj + + * elf32-avr.c (avr_elf32_load_records_from_section): Free + internal_relocs only if they aren't cached. + 2016-03-29 Nick Clifton PR 17334 diff --git a/bfd/elf32-avr.c b/bfd/elf32-avr.c index 91994f04d6b..764d0d1ffbc 100644 --- a/bfd/elf32-avr.c +++ b/bfd/elf32-avr.c @@ -4068,11 +4068,13 @@ avr_elf32_load_records_from_section (bfd *abfd, asection *sec) } free (contents); - free (internal_relocs); + if (elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); return r_list; load_failed: - free (internal_relocs); + if (elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); free (contents); free (r_list); return NULL;