Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"I am, therefore I am." -- Akira


devel / comp.unix.programmer / OT: on the meaning of the objdump addresses

SubjectAuthor
* OT: on the meaning of the objdump addressesMeredith Montgomery
`* Re: OT: on the meaning of the objdump addressesScott Lurndal
 `* Re: OT: on the meaning of the objdump addressesMeredith Montgomery
  `* Re: OT: on the meaning of the objdump addressesScott Lurndal
   +* Re: OT: on the meaning of the objdump addressesJorgen Grahn
   |`* Re: OT: on the meaning of the objdump addressesScott Lurndal
   | `* Re: OT: on the meaning of the objdump addressesKaz Kylheku
   |  `- Re: OT: on the meaning of the objdump addressesKenny McCormack
   `- Re: OT: on the meaning of the objdump addressesMeredith Montgomery

1
OT: on the meaning of the objdump addresses

<86fsrvkgty.fsf@levado.to>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16810&group=comp.unix.programmer#16810

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!aioe.org!qKfDLZ6owIcSvcG1xRHE9A.user.46.165.242.75.POSTED!not-for-mail
From: mmontgomery@levado.to (Meredith Montgomery)
Newsgroups: comp.unix.programmer
Subject: OT: on the meaning of the objdump addresses
Date: Tue, 16 Nov 2021 17:04:25 -0300
Organization: Aioe.org NNTP Server
Message-ID: <86fsrvkgty.fsf@levado.to>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: gioia.aioe.org; logging-data="26748"; posting-host="qKfDLZ6owIcSvcG1xRHE9A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
Cancel-Lock: sha1:ggDlUse3sKThtap/G3Vjh4hhvWY=
 by: Meredith Montgomery - Tue, 16 Nov 2021 20:04 UTC

Here's a brief passage from objdump on a MSYS2 system on Windows 10.

--8<---------------cut here---------------start------------->8---
%objdump.exe -D hello.exe
hello.exe: file format pei-x86-64

Disassembly of section .text:

0000000100401000 <WinMainCRTStartup>:
100401000: 55 push %rbp
100401001: 48 89 e5 mov %rsp,%rbp
100401004: 48 83 ec 20 sub $0x20,%rsp
100401008: 48 8d 0d 71 00 00 00 lea 0x71(%rip),%rcx # 100401080 <main>
10040100f: e8 0c 01 00 00 call 100401120 <msys_crt0>
[...]
--8<---------------cut here---------------end--------------->8---

What is the meaning of these hexadecimal addresses, first column?

I don't believe these addresses are really virtual-memory addresses,
meaning that machine code will be loaded to that place. But they could
be because it's just virtual memory. If they're not the right
addresses, why does the compiler or the linker (which?) write them in
the first place in the executable?

Is there any book that I could read that would explain these systems a
bit --- about any system specifically such as a FreeBSD, an OpenBSD or a
GNU system or Windows would be fine, too? Thank you!

I don't know where to ask this question, but I'm sure some of you know a
lot about this.

Re: OT: on the meaning of the objdump addresses

<GjUkJ.22411$cW6.16239@fx08.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16811&group=comp.unix.programmer#16811

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx08.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: OT: on the meaning of the objdump addresses
Newsgroups: comp.unix.programmer
References: <86fsrvkgty.fsf@levado.to>
Lines: 42
Message-ID: <GjUkJ.22411$cW6.16239@fx08.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Tue, 16 Nov 2021 20:15:34 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 16 Nov 2021 20:15:34 GMT
X-Received-Bytes: 2373
X-Original-Bytes: 2322
 by: Scott Lurndal - Tue, 16 Nov 2021 20:15 UTC

Meredith Montgomery <mmontgomery@levado.to> writes:
>Here's a brief passage from objdump on a MSYS2 system on Windows 10.
>
>--8<---------------cut here---------------start------------->8---
>%objdump.exe -D hello.exe
>hello.exe: file format pei-x86-64
>
>Disassembly of section .text:
>
>0000000100401000 <WinMainCRTStartup>:
> 100401000: 55 push %rbp
> 100401001: 48 89 e5 mov %rsp,%rbp
> 100401004: 48 83 ec 20 sub $0x20,%rsp
> 100401008: 48 8d 0d 71 00 00 00 lea 0x71(%rip),%rcx # 100401080 <main>
> 10040100f: e8 0c 01 00 00 call 100401120 <msys_crt0>
>[...]
>--8<---------------cut here---------------end--------------->8---
>
>What is the meaning of these hexadecimal addresses, first column?

As you suggest, these are the virtual addresses to which that code
will be loaded.

In generally, the executable file (PE COFF for Windows, ELF for Unix/Linux)
contains header which describes the layout of the executable file.

https://man7.org/linux/man-pages/man5/elf.5.html

The header will point to a table consisting of the program
sections that need to be loaded when the program is executed.
(called program headers in ELF). Each entry contains the
program address (which could be virtual, or if the code is
running sans the benefit of an operating system, it could
be physical) at which that section of the codefile should be
loaded.

The compiler doesn't generate addresses at all, most addresses in
intermediate object files are relocatable (generally relative to
the start of a function) and the final program
addresses are assigned by the linker (or for the case of dynamically
loaded shared objects, the run-time linker/loader).

Re: OT: on the meaning of the objdump addresses

<8635nukdz4.fsf@levado.to>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16812&group=comp.unix.programmer#16812

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!usenet.goja.nl.eu.org!aioe.org!boiGphxe8T1q+wuLMZIydg.user.46.165.242.75.POSTED!not-for-mail
From: mmontgomery@levado.to (Meredith Montgomery)
Newsgroups: comp.unix.programmer
Subject: Re: OT: on the meaning of the objdump addresses
Date: Wed, 17 Nov 2021 12:18:23 -0300
Organization: Aioe.org NNTP Server
Message-ID: <8635nukdz4.fsf@levado.to>
References: <86fsrvkgty.fsf@levado.to> <GjUkJ.22411$cW6.16239@fx08.iad>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: gioia.aioe.org; logging-data="58067"; posting-host="boiGphxe8T1q+wuLMZIydg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
Cancel-Lock: sha1:35RmNuqQIfs9ZXBsDA8bybpHElM=
 by: Meredith Montgomery - Wed, 17 Nov 2021 15:18 UTC

scott@slp53.sl.home (Scott Lurndal) writes:

> Meredith Montgomery <mmontgomery@levado.to> writes:
>>Here's a brief passage from objdump on a MSYS2 system on Windows 10.
>>
>>--8<---------------cut here---------------start------------->8---
>>%objdump.exe -D hello.exe
>>hello.exe: file format pei-x86-64
>>
>>Disassembly of section .text:
>>
>>0000000100401000 <WinMainCRTStartup>:
>> 100401000: 55 push %rbp
>> 100401001: 48 89 e5 mov %rsp,%rbp
>> 100401004: 48 83 ec 20 sub $0x20,%rsp
>> 100401008: 48 8d 0d 71 00 00 00 lea 0x71(%rip),%rcx # 100401080
>> <main>
>> 10040100f: e8 0c 01 00 00 call 100401120 <msys_crt0>
>>[...]
>>--8<---------------cut here---------------end--------------->8---
>>
>>What is the meaning of these hexadecimal addresses, first column?
>
> As you suggest, these are the virtual addresses to which that code
> will be loaded.
>
> In generally, the executable file (PE COFF for Windows, ELF for Unix/Linux)
> contains header which describes the layout of the executable file.
>
> https://man7.org/linux/man-pages/man5/elf.5.html

Thank you.

> The header will point to a table consisting of the program
> sections that need to be loaded when the program is executed.
> (called program headers in ELF). Each entry contains the
> program address (which could be virtual, or if the code is
> running sans the benefit of an operating system, it could
> be physical) at which that section of the codefile should be
> loaded.

That makes sense. Thank you. But, of course, when we see a virtual
address in an executable, we can't assume it will be loaded at that
exact address, right? I suppose the system reserves itself the right to
relocate these bytes in virtual memory itself. (Perhaps some DLL needs
some of these locations for whatever reason?)

> The compiler doesn't generate addresses at all, most addresses in
> intermediate object files are relocatable (generally relative to
> the start of a function) and the final program
> addresses are assigned by the linker (or for the case of dynamically
> loaded shared objects, the run-time linker/loader).

That makes sense. (By ``compiler'' I had in mind the whole
executable-production pipeline.) Perhaps an illustration of ``relative
to the start of a function'' is the following COFF hello.o.

--8<---------------cut here---------------start------------->8---
%objdump -d hello.o
hello.o: file format pe-x86-64
Disassembly of section .text:
0000000000000000 <main>:
0: 55 push %rbp
1: 48 89 e5 mov %rsp,%rbp
4: 48 83 ec 30 sub $0x30,%rsp
8: 89 4d 10 mov %ecx,0x10(%rbp)
b: 48 89 55 18 mov %rdx,0x18(%rbp)
f: 4c 89 45 20 mov %r8,0x20(%rbp)
[...]
--8<---------------cut here---------------end--------------->8---

The addresses there just serve as counting of the number of bytes the
code takes. For all I know it could even be just a nice output given by
objdump and not actually present in hello.o. I don't know.

Re: OT: on the meaning of the objdump addresses

<_JblJ.45927$SW5.717@fx45.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16813&group=comp.unix.programmer#16813

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx45.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: OT: on the meaning of the objdump addresses
Newsgroups: comp.unix.programmer
References: <86fsrvkgty.fsf@levado.to> <GjUkJ.22411$cW6.16239@fx08.iad> <8635nukdz4.fsf@levado.to>
Lines: 105
Message-ID: <_JblJ.45927$SW5.717@fx45.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Wed, 17 Nov 2021 18:20:42 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Wed, 17 Nov 2021 18:20:42 GMT
X-Received-Bytes: 5353
X-Original-Bytes: 5302
 by: Scott Lurndal - Wed, 17 Nov 2021 18:20 UTC

Meredith Montgomery <mmontgomery@levado.to> writes:
>scott@slp53.sl.home (Scott Lurndal) writes:
>
>> Meredith Montgomery <mmontgomery@levado.to> writes:
>>>Here's a brief passage from objdump on a MSYS2 system on Windows 10.
>>>
>>>--8<---------------cut here---------------start------------->8---
>>>%objdump.exe -D hello.exe
>>>hello.exe: file format pei-x86-64
>>>
>>>Disassembly of section .text:
>>>
>>>0000000100401000 <WinMainCRTStartup>:

>>>What is the meaning of these hexadecimal addresses, first column?
>>
[snip]
>
>> The header will point to a table consisting of the program
>> sections that need to be loaded when the program is executed.
>> (called program headers in ELF). Each entry contains the
>> program address (which could be virtual, or if the code is
>> running sans the benefit of an operating system, it could
>> be physical) at which that section of the codefile should be
>> loaded.
>
>That makes sense. Thank you. But, of course, when we see a virtual
>address in an executable, we can't assume it will be loaded at that
>exact address, right?

It must, by definition, be loaded at that virtual address.

If you're not familiar with how virtual memory works, a quick
high-level refresher:

Modern (post 80286 for intel, earlier for mainframes) CPU's
support multiple "address spaces". Leaving aside the exotic
systems like the B6500, there is physical address space and
one or more virtual address spaces.

Processors support virtual address spaces using translation
tables in memory that translate a virtual address into a
corresponding physical address which describes the actual
location in memory of the data referred via the virtual address.

Each process/task/thread supported the operating system will
have an unique virtual address space assigned to it, and the
physical memory will be apportioned between those virtual address
spaces by the operating system as needs require. If a valid
translation is not present for a virtual address, the processor
traps to the operating system to resolve the issue (i.e. allocate
a free physical page to the virtual address and, if necessary,
loading the required data from backing storage into that newly
allocated page). Returning from the trap will re-execute the
instruction that caused the "page fault" and the application will
continue using the data at the newly loaded virtual page.

>I suppose the system reserves itself the right to
>relocate these bytes in virtual memory itself. (Perhaps some DLL needs
>some of these locations for whatever reason?)

Shared objects (Unix/Linux) and Dynamically Linked Libraries (DLLs in windows)
are compiled into what is called "Position Independent Code" and
use various indirection techniques to interface between the library
and the application such that the libraries can be loaded anywhere
in the virtual address space.

>
>> The compiler doesn't generate addresses at all, most addresses in
>> intermediate object files are relocatable (generally relative to
>> the start of a function) and the final program
>> addresses are assigned by the linker (or for the case of dynamically
>> loaded shared objects, the run-time linker/loader).
>
>That makes sense. (By ``compiler'' I had in mind the whole
>executable-production pipeline.) Perhaps an illustration of ``relative
>to the start of a function'' is the following COFF hello.o.
>
>--8<---------------cut here---------------start------------->8---
>%objdump -d hello.o
>hello.o: file format pe-x86-64
>Disassembly of section .text:
>0000000000000000 <main>:
> 0: 55 push %rbp
> 1: 48 89 e5 mov %rsp,%rbp
> 4: 48 83 ec 30 sub $0x30,%rsp
> 8: 89 4d 10 mov %ecx,0x10(%rbp)
> b: 48 89 55 18 mov %rdx,0x18(%rbp)
> f: 4c 89 45 20 mov %r8,0x20(%rbp)
>[...]
>--8<---------------cut here---------------end--------------->8---
>
>The addresses there just serve as counting of the number of bytes the
>code takes. For all I know it could even be just a nice output given by
>objdump and not actually present in hello.o. I don't know.

They are produced by the disassembler as it interprets the bytestream,
since instructions on x86 are variable in length. The object file
you dumped also contains a relocation table with entries that point to bytes
within the instruction byte stream that contain addresses to unresolved
symbols and the linker uses the relocation entries to update the
instruction stream with the correct address of the symbol after it
has been determined.

Re: OT: on the meaning of the objdump addresses

<slrnspbvq5.1rfm.grahn+nntp@frailea.sa.invalid>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16814&group=comp.unix.programmer#16814

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: grahn+nntp@snipabacken.se (Jorgen Grahn)
Newsgroups: comp.unix.programmer
Subject: Re: OT: on the meaning of the objdump addresses
Date: 18 Nov 2021 07:22:45 GMT
Lines: 46
Message-ID: <slrnspbvq5.1rfm.grahn+nntp@frailea.sa.invalid>
References: <86fsrvkgty.fsf@levado.to> <GjUkJ.22411$cW6.16239@fx08.iad>
<8635nukdz4.fsf@levado.to> <_JblJ.45927$SW5.717@fx45.iad>
X-Trace: individual.net oOAto5ZVEYD/PoGu5bzrtQubPvktjL1hgRMbe41a+e+CguV3To
Cancel-Lock: sha1:vpX1ZDj54L4x7XLr0Xk8JX9G1fs=
User-Agent: slrn/1.0.3 (OpenBSD)
 by: Jorgen Grahn - Thu, 18 Nov 2021 07:22 UTC

On Wed, 2021-11-17, Scott Lurndal wrote:
> Meredith Montgomery <mmontgomery@levado.to> writes:
>>scott@slp53.sl.home (Scott Lurndal) writes:
>>
>>> Meredith Montgomery <mmontgomery@levado.to> writes:
>>>>Here's a brief passage from objdump on a MSYS2 system on Windows 10.
>>>>
>>>>--8<---------------cut here---------------start------------->8---
>>>>%objdump.exe -D hello.exe
>>>>hello.exe: file format pei-x86-64
>>>>
>>>>Disassembly of section .text:
>>>>
>>>>0000000100401000 <WinMainCRTStartup>:
>
>>>>What is the meaning of these hexadecimal addresses, first column?
>>>
> [snip]
>>
>>> The header will point to a table consisting of the program
>>> sections that need to be loaded when the program is executed.
>>> (called program headers in ELF). Each entry contains the
>>> program address (which could be virtual, or if the code is
>>> running sans the benefit of an operating system, it could
>>> be physical) at which that section of the codefile should be
>>> loaded.
>>
>>That makes sense. Thank you. But, of course, when we see a virtual
>>address in an executable, we can't assume it will be loaded at that
>>exact address, right?
>
> It must, by definition, be loaded at that virtual address.

Yes, and it has important effects, such as seeing the same addresses
in core dumps and various stack traces.

Shared libraries, on the other hand, are not loaded into predictable
addresses.

[long snip]

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .

Re: OT: on the meaning of the objdump addresses

<lNwlJ.19816$aY3.17160@fx21.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16815&group=comp.unix.programmer#16815

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx21.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: OT: on the meaning of the objdump addresses
Newsgroups: comp.unix.programmer
References: <86fsrvkgty.fsf@levado.to> <GjUkJ.22411$cW6.16239@fx08.iad> <8635nukdz4.fsf@levado.to> <_JblJ.45927$SW5.717@fx45.iad> <slrnspbvq5.1rfm.grahn+nntp@frailea.sa.invalid>
Lines: 52
Message-ID: <lNwlJ.19816$aY3.17160@fx21.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 18 Nov 2021 18:17:53 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 18 Nov 2021 18:17:53 GMT
X-Received-Bytes: 2939
 by: Scott Lurndal - Thu, 18 Nov 2021 18:17 UTC

Jorgen Grahn <grahn+nntp@snipabacken.se> writes:
>On Wed, 2021-11-17, Scott Lurndal wrote:
>> Meredith Montgomery <mmontgomery@levado.to> writes:
>>>scott@slp53.sl.home (Scott Lurndal) writes:
>>>
>>>> Meredith Montgomery <mmontgomery@levado.to> writes:
>>>>>Here's a brief passage from objdump on a MSYS2 system on Windows 10.
>>>>>
>>>>>--8<---------------cut here---------------start------------->8---
>>>>>%objdump.exe -D hello.exe
>>>>>hello.exe: file format pei-x86-64
>>>>>
>>>>>Disassembly of section .text:
>>>>>
>>>>>0000000100401000 <WinMainCRTStartup>:
>>
>>>>>What is the meaning of these hexadecimal addresses, first column?
>>>>
>> [snip]
>>>
>>>> The header will point to a table consisting of the program
>>>> sections that need to be loaded when the program is executed.
>>>> (called program headers in ELF). Each entry contains the
>>>> program address (which could be virtual, or if the code is
>>>> running sans the benefit of an operating system, it could
>>>> be physical) at which that section of the codefile should be
>>>> loaded.
>>>
>>>That makes sense. Thank you. But, of course, when we see a virtual
>>>address in an executable, we can't assume it will be loaded at that
>>>exact address, right?
>>
>> It must, by definition, be loaded at that virtual address.
>
>Yes, and it has important effects, such as seeing the same addresses
>in core dumps and various stack traces.
>
>Shared libraries, on the other hand, are not loaded into predictable
>addresses.

While generally true, there was a period of time in the 1980s
when SVR3.2 had a form of COFF static shared library that required loading at
a fixed address. Made it very complicated to include multiple shared
libraries an application without the VAs clashing, particularly in
a 32-bit address space where half was occupied by the OS (3b2, x86).

John Levine discusses them here:

https://www.cs.tufts.edu%2F~nr%2Fcs257%2Farchive%2Fjohn-levine%2Flinker09.ps.gz

Note that you'll need some form of postscript reader (e.g. ghostscript)
to read the document. It is _not_ pdf.

Re: OT: on the meaning of the objdump addresses

<20211118222512.683@kylheku.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16816&group=comp.unix.programmer#16816

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: 480-992-1380@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.programmer
Subject: Re: OT: on the meaning of the objdump addresses
Date: Fri, 19 Nov 2021 06:34:01 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <20211118222512.683@kylheku.com>
References: <86fsrvkgty.fsf@levado.to> <GjUkJ.22411$cW6.16239@fx08.iad>
<8635nukdz4.fsf@levado.to> <_JblJ.45927$SW5.717@fx45.iad>
<slrnspbvq5.1rfm.grahn+nntp@frailea.sa.invalid>
<lNwlJ.19816$aY3.17160@fx21.iad>
Injection-Date: Fri, 19 Nov 2021 06:34:01 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="80bbd794b877a1c9d26dc018ad1d6f39";
logging-data="24786"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX195GYiWe0V0YZJIuFn7mwcrPeXb3kuUyCM="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:KxF+S68d+C3Rn5vPAI3b4dE8uxE=
 by: Kaz Kylheku - Fri, 19 Nov 2021 06:34 UTC

On 2021-11-18, Scott Lurndal <scott@slp53.sl.home> wrote:
> Jorgen Grahn <grahn+nntp@snipabacken.se> writes:
>>On Wed, 2021-11-17, Scott Lurndal wrote:
>>Shared libraries, on the other hand, are not loaded into predictable
>>addresses.
>
> While generally true, there was a period of time in the 1980s
> when SVR3.2 had a form of COFF static shared library that required loading at
> a fixed address.

There was a period of time in the 1990's, when GNU/Linux distros had the
same thing.

This is why we have "libc.so.6", where the 6 has nothing to do with the
GLibc 2 version number.

Prior to that there were libc4 and libc5 based on GNU C Library 1.

Under libc4, binaries were a.out, and I think shared libraries were
still not relocatable. It may be libc5 that made them relocatable.
libc6 was then based of GNU C Library 2, and so we have that 6 in the
sonames.

Re: OT: on the meaning of the objdump addresses

<sn7n54$q4g7$2@news.xmission.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16817&group=comp.unix.programmer#16817

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.programmer
Subject: Re: OT: on the meaning of the objdump addresses
Date: Fri, 19 Nov 2021 08:27:16 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <sn7n54$q4g7$2@news.xmission.com>
References: <86fsrvkgty.fsf@levado.to> <slrnspbvq5.1rfm.grahn+nntp@frailea.sa.invalid> <lNwlJ.19816$aY3.17160@fx21.iad> <20211118222512.683@kylheku.com>
Injection-Date: Fri, 19 Nov 2021 08:27:16 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="856583"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Fri, 19 Nov 2021 08:27 UTC

In article <20211118222512.683@kylheku.com>,
Kaz Kylheku <480-992-1380@kylheku.com> wrote:
....
>> While generally true, there was a period of time in the 1980s
>> when SVR3.2 had a form of COFF static shared library that required loading at
>> a fixed address.
>
>There was a period of time in the 1990's, when GNU/Linux distros had the
>same thing.
>
>This is why we have "libc.so.6", where the 6 has nothing to do with the
>GLibc 2 version number.
>
>Prior to that there were libc4 and libc5 based on GNU C Library 1.
>
>Under libc4, binaries were a.out, and I think shared libraries were
>still not relocatable. It may be libc5 that made them relocatable.
>libc6 was then based of GNU C Library 2, and so we have that 6 in the
>sonames.

But what about (and whatever became of) libcs 1, 2, and 3?

--
b w r w g y b r y b

Re: OT: on the meaning of the objdump addresses

<868rxkklfz.fsf@levado.to>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16818&group=comp.unix.programmer#16818

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!aioe.org!A5viUP7ZdBSpM8+So1ywOw.user.46.165.242.75.POSTED!not-for-mail
From: mmontgomery@levado.to (Meredith Montgomery)
Newsgroups: comp.unix.programmer
Subject: Re: OT: on the meaning of the objdump addresses
Date: Fri, 19 Nov 2021 16:13:52 -0300
Organization: Aioe.org NNTP Server
Message-ID: <868rxkklfz.fsf@levado.to>
References: <86fsrvkgty.fsf@levado.to> <GjUkJ.22411$cW6.16239@fx08.iad>
<8635nukdz4.fsf@levado.to> <_JblJ.45927$SW5.717@fx45.iad>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: gioia.aioe.org; logging-data="31445"; posting-host="A5viUP7ZdBSpM8+So1ywOw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
Cancel-Lock: sha1:7rv5jmGMq+8PFoV835p0kYu1FHM=
X-Notice: Filtered by postfilter v. 0.9.2
 by: Meredith Montgomery - Fri, 19 Nov 2021 19:13 UTC

scott@slp53.sl.home (Scott Lurndal) writes:

> Meredith Montgomery <mmontgomery@levado.to> writes:
>>scott@slp53.sl.home (Scott Lurndal) writes:
>>
>>> Meredith Montgomery <mmontgomery@levado.to> writes:
>>>>Here's a brief passage from objdump on a MSYS2 system on Windows 10.
>>>>
>>>>--8<---------------cut here---------------start------------->8---
>>>>%objdump.exe -D hello.exe
>>>>hello.exe: file format pei-x86-64
>>>>
>>>>Disassembly of section .text:
>>>>
>>>>0000000100401000 <WinMainCRTStartup>:
>
>>>>What is the meaning of these hexadecimal addresses, first column?
>>>
> [snip]
>>
>>> The header will point to a table consisting of the program
>>> sections that need to be loaded when the program is executed.
>>> (called program headers in ELF). Each entry contains the
>>> program address (which could be virtual, or if the code is
>>> running sans the benefit of an operating system, it could
>>> be physical) at which that section of the codefile should be
>>> loaded.
>>
>>That makes sense. Thank you. But, of course, when we see a virtual
>>address in an executable, we can't assume it will be loaded at that
>>exact address, right?
>
> It must, by definition, be loaded at that virtual address.
>
> If you're not familiar with how virtual memory works, a quick
> high-level refresher:

Thank you. That was a very nice read along with the subsequent posts
that followed. I do have a much better picture in mind now. Thanks
very much.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor