fail gracefully on program without any loadable sections
Alexandre Oliva
aoliva@redhat.com
Fri Mar 14 03:37:00 GMT 2003
On Mar 14, 2003, Roland McGrath <roland@redhat.com> wrote:
> I would like to have a test case for this. How did you make the file you
> tried to load that has this problem?
I don't recall whether it was a bug in the compiler, the linker or in
glibc data structures that triggered this particular condition, but
it's definitely not something that you'd find in real life. I'm ok
with leaving it out, I just thought it would be nice to produce a
reasonable error message in this case, otherwise we'll likely just
crash in the next few instructions (note that we index loadcmds on
nloadcmds - 1, so if nloadcmds is zero, you get garbage).
Anyway, here's the patch, with ChangeLog adjusted as requested.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dl-load-no-sections.patch
Type: text/x-patch
Size: 785 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20030314/865af267/attachment.bin>
-------------- next part --------------
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer
More information about the Libc-alpha
mailing list