[PATCH, COMMITTED]: Fix seg fault in elf32.em:_after_open
Pedro Alves
pedro@codesourcery.com
Fri Aug 20 15:31:00 GMT 2010
More information about the Binutils mailing list
Fri Aug 20 15:31:00 GMT 2010
- Previous message (by thread): [PATCH, COMMITTED]: Fix seg fault in elf32.em:_after_open
- Next message (by thread): [PATCH, COMMITTED]: Fix seg fault in elf32.em:_after_open
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Friday 20 August 2010 16:00:30, Nick Clifton wrote: > Whilst working on another bug I came across a seg-fault in the > _after_open() function in elf32.em. If the target is not an ELF > binary then get_elf_backend_data will return NULL, but the code was > not checking for this. Fixed by applying the following patch. (...) > bed = get_elf_backend_data (abfd); > ! if (bed == NULL) > ! s = NULL; > ! else > ! s = bfd_make_section_with_flags (abfd, ".eh_frame_hdr", > ! bed->dynamic_sec_flags > ! | SEC_READONLY); Is it valid to call get_elf_backend_data on a non-elf bfd at all? #define get_elf_backend_data(abfd) \ xvec_get_elf_backend_data ((abfd)->xvec) #define bfd_mach_o_get_backend_data(abfd) \ ((bfd_mach_o_backend_data*)(abfd)->xvec->backend_data) .#define coff_backend_info(abfd) \ . ((bfd_coff_backend_data *) (abfd)->xvec->backend_data) It appears that for other flavours, it may happen to return something undefined. Shouldn't that check be something like bfd_get_flavour (abfd) != bfd_target_elf_flavour instead? -- Pedro Alves
- Previous message (by thread): [PATCH, COMMITTED]: Fix seg fault in elf32.em:_after_open
- Next message (by thread): [PATCH, COMMITTED]: Fix seg fault in elf32.em:_after_open
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list