Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #9324 > unrolled thread

Linux reading a file

Started byBill Cunningham <nospam@nspam.invalid>
First post2018-10-20 19:25 +0000
Last post2018-10-20 23:49 +0200
Articles 5 — 3 participants

Back to article view | Back to comp.programming


Contents

  Linux reading a file Bill Cunningham <nospam@nspam.invalid> - 2018-10-20 19:25 +0000
    Re: Linux reading a file Melzzzzz <Melzzzzz@zzzzz.com> - 2018-10-20 19:38 +0000
      Re: Linux reading a file Bill Cunningham <nospam@nspam.invalid> - 2018-10-20 20:03 +0000
        Re: Linux reading a file Bill Cunningham <nospam@nspam.invalid> - 2018-10-21 18:55 +0000
    Re: Linux reading a file Wouter Verhelst <w@uter.be> - 2018-10-20 23:49 +0200

#9324 — Linux reading a file

FromBill Cunningham <nospam@nspam.invalid>
Date2018-10-20 19:25 +0000
SubjectLinux reading a file
Message-ID<XnsA9819CFC0DF84123321@46.165.242.75>
IN the ELF binary format. The program interpreter code in the binary is 
copied by linux and loaded. What part of the OS does this? This is pointed 
to by program headers in the binary. Does anyone know where I can get the 
ABI standard without having to pay a bunch of money for it? ISO wants to 
sell it. :(

Bill

[toc] | [next] | [standalone]


#9325

FromMelzzzzz <Melzzzzz@zzzzz.com>
Date2018-10-20 19:38 +0000
Message-ID<zuLyD.102435$6N5.97389@fx29.am4>
In reply to#9324
On 2018-10-20, Bill Cunningham <nospam@nspam.invalid> wrote:
> IN the ELF binary format. The program interpreter code in the binary is 
> copied by linux and loaded. What part of the OS does this? This is pointed 
> to by program headers in the binary. Does anyone know where I can get the 
> ABI standard without having to pay a bunch of money for it? ISO wants to 
> sell it. :(

I beleive elf loading and running is well documented.
>
> Bill


-- 
press any key to continue or any other to quit...

[toc] | [prev] | [next] | [standalone]


#9326

FromBill Cunningham <nospam@nspam.invalid>
Date2018-10-20 20:03 +0000
Message-ID<XnsA981A36B4ECE0123321@46.165.242.75>
In reply to#9325
Melzzzzz <Melzzzzz@zzzzz.com> wrote in
news:zuLyD.102435$6N5.97389@fx29.am4: 


> 
> I beleive elf loading and running is well documented.
>>
I found this and I think this might be exactly what I am looking for. It 
looks like the real and actual way things are done. My these people's C is 
is incredibly better than mine! I will post the URL for anyone else who 
might be interested. But I am looking too for more than ELF.

https://lwn.net/Articles/631631/

Bingo!

[toc] | [prev] | [next] | [standalone]


#9328

FromBill Cunningham <nospam@nspam.invalid>
Date2018-10-21 18:55 +0000
Message-ID<XnsA98297C5B3190123321@46.165.242.75>
In reply to#9326
Bill Cunningham <nospam@nspam.invalid> wrote in
news:XnsA981A36B4ECE0123321@46.165.242.75: 

> Melzzzzz <Melzzzzz@zzzzz.com> wrote in
> news:zuLyD.102435$6N5.97389@fx29.am4: 


refspecs.linuxfoundation.org

ABI specs

[toc] | [prev] | [next] | [standalone]


#9327

FromWouter Verhelst <w@uter.be>
Date2018-10-20 23:49 +0200
Message-ID<lgks9f-rnf.ln1@gangtai.home.grep.be>
In reply to#9324
On 20/10/18 21:25, Bill Cunningham wrote:
> IN the ELF binary format. The program interpreter code in the binary is 
> copied by linux and loaded. What part of the OS does this?

Multiple parts.

The kernel is involved, obviously. The exec() system call is implemented
by the kernel; it maps the first page of the ELF binary into memory, and
then starts the program there.

If the program in question is a dynamically-linked binary, then the
first bit of code will initialize the run-time dynamic linker (RTDL),
which is part of the C library. The kernel will load that part too. On
x86_64 Linux with the GNU C library (glibc), the RTDL is
/lib64/ld-linux-x86-64.so.2; on x86 Linux, it is instead /lib/ld-linux.so.2

The RTDL will then read the necessary ELF headers, and ask the kernel to
also map in the shared libraries that those ELF headers tell it are
needed by the program in question.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.programming


csiph-web