[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/290] ld dumps core on bad input.
From: |
nickc at redhat dot com |
Subject: |
[Bug ld/290] ld dumps core on bad input. |
Date: |
29 Jul 2004 15:38:14 -0000 |
------- Additional Comments From nickc at redhat dot com 2004-07-29 15:38
-------
Subject: Re: ld dumps core on bad input.
Hi H.J.
How about this patch as a solution ?
Cheers
Nick
bfd/ChangeLog
2004-07-29 Nick Clifton <address@hidden>
PR 290
* elf.c (assign_section_numbers): Cope gracefully with sections
which have SHF_LINK_ORDER set but no sh_link set up.
Index: bfd/elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.236
diff -c -3 -p -r1.236 elf.c
*** bfd/elf.c 27 Jul 2004 14:20:47 -0000 1.236
--- bfd/elf.c 29 Jul 2004 15:35:45 -0000
*************** assign_section_numbers (bfd *abfd)
*** 2885,2894 ****
int elfsec
= _bfd_elf_section_from_bfd_section (s->owner, s);
elfsec = elf_shdrp[elfsec]->sh_link;
! BFD_ASSERT (elfsec != 0);
! s = elf_shdrp[elfsec]->bfd_section->output_section;
! BFD_ASSERT (s != NULL);
! d->this_hdr.sh_link = elf_section_data (s)->this_idx;
break;
}
}
--- 2885,2905 ----
int elfsec
= _bfd_elf_section_from_bfd_section (s->owner, s);
elfsec = elf_shdrp[elfsec]->sh_link;
! /* PR 290:
! The Intel C compiler generates SHT_IA_64_UNWIND with
! SHF_LINK_ORDER. But it doesn't set theh sh_link or
! sh_info fields. Hence we could get the situation
! where elfsec is 0. */
! if (elfsec == 0)
! _bfd_error_handler
! (_("%s: warning: sh_link not set for section %s"),
! bfd_get_filename (abfd), bfd_get_section_name (abfd,
s));
! else
! {
! s = elf_shdrp[elfsec]->bfd_section->output_section;
! BFD_ASSERT (s != NULL);
! d->this_hdr.sh_link = elf_section_data (s)->this_idx;
! }
break;
}
}
--
http://sources.redhat.com/bugzilla/show_bug.cgi?id=290
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
- [Bug ld/290] New: ld dumps core on bad input., hjl at lucon dot org, 2004/07/28
- [Bug ld/290] ld dumps core on bad input., hjl at lucon dot org, 2004/07/28
- [Bug ld/290] ld dumps core on bad input.,
nickc at redhat dot com <=
- [Bug ld/290] ld dumps core on bad input., hjl at lucon dot org, 2004/07/29
- [Bug ld/290] ld dumps core on bad input., hjl at lucon dot org, 2004/07/29
- [Bug ld/290] ld dumps core on bad input., hjl at lucon dot org, 2004/07/29
- [Bug ld/290] ld dumps core on bad input., nickc at redhat dot com, 2004/07/30