This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Question: short-read while loading .so file
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: "ISHIKAWA,chiaki" <ishikawa at yk dot rim dot or dot jp>, Binutils <binutils at sourceware dot org>
- Cc: ishikawa <chiaki dot ishikawa at ubin dot jp>
- Date: Fri, 05 Jun 2015 17:07:43 +0100
- Subject: Re: Question: short-read while loading .so file
- Authentication-results: sourceware.org; auth=none
- References: <5571C58F dot 9050600 at yk dot rim dot or dot jp>
On 05/06/15 16:51, ISHIKAWA,chiaki wrote:
> My surprise was that during the test of mozilla thunderbird when I
> I injected the "short read" to a few files, I made a mistake of
> applying short tread to a few .so files and
> I observed that these *.so files were dynamically loaded by such short
> |read|.
dynamic linker is a libc issue so send the report
to libc-alpha instead of binutils mailing list.
(assuming you use glibc).
> That is, when the request to read these relatively small .so files by
> |read| with requested # of octets being 4096, my hand-crafted prelaoded
> |read| reads only 4036 (4096 - 60) octets, but
> the dynamic loader did not request the remaining 60 octets, and merrily
> went on running.
>
> My question is:
>
> Does the loader handle "short read" properly by issuing additional
> |read| if it notices that it needs to read more octets which are missing
> from the data structure read partially by the first |read|?
>
> Or was I just lucky that the last 60 octets (and presumably more octets
> before the last 60 octets) were mere fillers and the real code and data
> lived only the initial portion of 4096 octets, and that the failure to
> read the last 60 octets did not cause any issues in this particular run?
>
sounds like a bug, but libc-alpha will know better
> Yes, the mozilla thunderbird did not crash or anything although no
> additional read was issued to read the remaining 60 octets.
>
> That is why I am asking this question.
>
> Thank you in advance for your attention.
>
> Best Regards,
> Chiaki Ishikawa
>
>
>
>
>
>