[Toybox] [PATCH] readelf: fix an off-by-one and a missing newline.

enh enh at google.com
Tue May 16 17:34:27 PDT 2023


okay, here's a new version of the patch where the offset+length is
hopefully clearer. (the errors are better too.)

On Mon, Apr 24, 2023 at 5:35 PM enh <enh at google.com> wrote:

> yeah, sorry --- i haven't had time to debug this yet. (and so probably
> shouldn't have sent a patch yet, or at least just stuck to the obvious `\n`
> problem!)
>
> there's clearly _something_ wrong with this specific ELF file, but i
> actually just took gnu readelf/llvm readelf's [implicit] word for it [since
> they had no warnings/errors] that it _wasn't_ the offset. (and i haven't
> had time today to draw myself a picture to convince myself one way or
> another whether there's an off-by-one here.)
>
> i'll get back to you when i've actually worked out why Android's dynamic
> linker ends up looking at a bunch of 'X's in the file as if they're a
> dynamic header (despite the fact that a quick hex dump of the dynamic
> section looks plausible).
>
> On Mon, Apr 24, 2023 at 4:55 AM Rob Landley <rob at landley.net> wrote:
>
>> On 4/21/23 20:59, Rob Landley wrote:
>> > On 4/21/23 15:02, enh via Toybox wrote:
>> >> Bug: https://github.com/android/ndk/issues/1866
>> >> <https://github.com/android/ndk/issues/1866>
>> >> ---
>> >>  toys/other/readelf.c | 4 ++--
>> >>  1 file changed, 2 insertions(+), 2 deletions(-)
>> >
>> > If offset == size you're one past the end of the file?
>> >
>> > What's the bug slash use case here?
>>
>> For reference, I read the thread and downloaded the libbz2.so they
>> referenced
>> and ran readelf -a on it, and didn't see an error message?
>>
>> (Happy to apply the fix, but I still don't quite understand the issue,
>> and kinda
>> want to reproduce it and add a test...)
>>
>> > Rob
>>
>> Rob
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20230516/dd8ca13f/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-readelf-fix-an-off-by-one-and-improve-warnings.patch
Type: text/x-patch
Size: 2573 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20230516/dd8ca13f/attachment.bin>


More information about the Toybox mailing list