public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Yann Droneaud <ydroneaud@opteya.com>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: "libc-alpha@sourceware.org" <libc-alpha@sourceware.org>,
	Leandro Pereira <Leandro.Pereira@microsoft.com>
Subject: Re: [PATCH 2/2] elf: Use nocancel pread64() instead of lseek()+read()
Date: Thu, 03 Oct 2019 19:04:00 -0000	[thread overview]
Message-ID: <bca04e4d9826e5b5b611a8b6c2b225cf53807e08.camel@opteya.com> (raw)
In-Reply-To: <87imp5r9pr.fsf@igel.home>

Hi,

Le jeudi 03 octobre 2019 à 19:59 +0200, Andreas Schwab a écrit :
> On Okt 03 2019, Yann Droneaud <ydroneaud@opteya.com> wrote:
> 
> > Anyway I'm quite surprised ld.so is reading twice 68 bytes at the
> > same
> > 792 offset. Moreover, the first read already brought 28 bytes out
> > of
> > 68.
> 
> That only happens if you have a note segment that does not fit in the
> initial file buffer.  That is rather unusual.
> 

Not sure about it being unusual: on Fedora 30, x86_64, I see this
behavior with /bin/false /bin/true /bin/test /bin/uname 

openat(AT_FDCWD, "/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3"..., 832)      = 832
lseek(3, 792, SEEK_SET)                 = 792
read(3, "\4\0\0\0\24\0\0\0"..., 68)     = 68
fstat(3, {st_mode=S_IFREG|0755, st_size=6697832, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x7f8bc04b5000
lseek(3, 792, SEEK_SET)                 = 792
read(3, "\4\0\0\0\24\0\0\0"..., 68)     = 68
lseek(3, 864, SEEK_SET)                 = 864
read(3, "\4\0\0\0\20\0\0\0"..., 32)     = 32


$ file /bin/false /bin/true /bin/test /bin/uname 
/bin/false: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV),
dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for
GNU/Linux 3.2.0,
BuildID[sha1]=790d23abaaa68bb496873f5afc647dd6be30f94c, stripped, too
many notes (256)
/bin/true:  ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV),
dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for
GNU/Linux 3.2.0,
BuildID[sha1]=8e348e43f020cfa72b8abed7e69b54558165fb2e, stripped, too
many notes (256)
/bin/test:  ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV),
dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for
GNU/Linux 3.2.0,
BuildID[sha1]=5dee19457e437541fe30f58d3d4add118567e806, stripped, too
many notes (256)
/bin/uname: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV),
dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for
GNU/Linux 3.2.0,
BuildID[sha1]=50b398bf94ad5a081eb4178d976d4f290977f99a, stripped, too
many notes (256)

Too many notes ?

Regards.

-- 
Yann Droneaud
OPTEYA


  reply	other threads:[~2019-10-03 19:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-05 21:56 Leandro Pereira
2019-10-03 13:59 ` Carlos O'Donell
2019-10-18 20:02   ` Carlos O'Donell
2019-10-20 21:37     ` Lukasz Majewski
2019-10-21 13:24       ` Carlos O'Donell
2019-10-24 12:08         ` Florian Weimer
2019-10-24 13:32           ` Carlos O'Donell
2019-10-24 13:46             ` Florian Weimer
2019-10-03 15:31 ` Yann Droneaud
2019-10-03 17:10   ` Carlos O'Donell
2019-10-03 17:59   ` Andreas Schwab
2019-10-03 19:04     ` Yann Droneaud [this message]
2019-10-03 19:16       ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bca04e4d9826e5b5b611a8b6c2b225cf53807e08.camel@opteya.com \
    --to=ydroneaud@opteya.com \
    --cc=Leandro.Pereira@microsoft.com \
    --cc=libc-alpha@sourceware.org \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).