Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

patch in

31 views
Skip to first unread message

hongy...@gmail.com

unread,
Sep 20, 2021, 5:06:19 AM9/20/21
to
The following statement comes from here [1]:

A program contains machine language instructions (and some data), usually created by an assembler, and if needed, a compiler. It usually uses a dynamic linker to patch in addresses needed for relocation and handle segment loading, but otherwise is processed directly by the cpu.

[1] https://groups.google.com/g/comp.unix.shell/c/S7PeSyYu15E/m/XpmYtFKkCgAJ

Can I change the phrase "patch in" into "patch" here?

Regards,
HZ

Tony Cooper

unread,
Sep 20, 2021, 8:51:55 AM9/20/21
to
Not in my opinion. To "patch in addresses" means to add addresses at
the appropriate point. To "patch addresses" means to fix or add
information to individual addresses.

--

Tony Cooper Orlando Florida

Peter Moylan

unread,
Sep 20, 2021, 10:31:59 PM9/20/21
to
I agree with you. From my knowledge of how linkers work, I therefore
conclude that "patch" is correct and "patch in" is completely wrong.

Software patches overlay what was already there, using no additional
space. "Patch in" would imply insertions, requiring adjacent data to be
moved sideways, and that's not what happens.

--
Peter Moylan Newcastle, NSW http://www.pmoylan.org
x

Quinn C

unread,
Sep 21, 2021, 10:09:17 AM9/21/21
to
* Peter Moylan:
I don't know enough about how the linker works to say which ohne
applies, but the word "software patch" also applies when you patch the
source code and recompile. In that case, insertion is not a problem.

I don't think all those patches that made it the "Apache" server were on
machine code level.
--
Manche Dinge sind vorgeschrieben, weil man sie braucht, andere
braucht man nur, weil sie vorgeschrieben sind.
-- Helmut Richter in de.etc.sprache.deutsch

Kerr-Mudd, John

unread,
Sep 21, 2021, 2:46:41 PM9/21/21
to
I disagree, the machine code is created with dummy addresses (probably 0000). the linker then patches those values to the locations of the actual routines. I'm happy to allow that the those addresses are "patched in".

--
Bah, and indeed Humbug.

Rich Ulrich

unread,
Sep 22, 2021, 1:40:38 AM9/22/21
to
On Tue, 21 Sep 2021 12:31:54 +1100, Peter Moylan
<pe...@pmoylan.org.invalid> wrote:

>On 20/09/21 23:51, Tony Cooper wrote:
>> On Mon, 20 Sep 2021 02:06:16 -0700 (PDT), "hongy...@gmail.com"
>> <hongy...@gmail.com> wrote:
>>
>>> The following statement comes from here [1]:
>>>
>>> A program contains machine language instructions (and some data),
>>> usually created by an assembler, and if needed, a compiler. It
>>> usually uses a dynamic linker to patch in addresses needed for
>>> relocation and handle segment loading, but otherwise is processed
>>> directly by the cpu.
>>>
>>> [1]
>>> https://groups.google.com/g/comp.unix.shell/c/S7PeSyYu15E/m/XpmYtFKkCgAJ
>>>
>>>
>>>
>>>
>Can I change the phrase "patch in" into "patch" here?
>>>
>>
>> Not in my opinion. To "patch in addresses" means to add addresses at
>> the appropriate point. To "patch addresses" means to fix or add
>> information to individual addresses.
>
>I agree with you. From my knowledge of how linkers work, I therefore
>conclude that "patch" is correct and "patch in" is completely wrong.

No, "patch in" is the better term. For a hack, you might "patch" and
change some legitimate address. To me, "patch" implies a correction,
a modification of something that otherwise is legitimate. That is not
what a dynamic linker does when it fills a reserved spot. It patches
in the address where the address was expected. In multiple places.

My applications with Fortran would give a linker the name of the
main program file as a .rel file, and one or more files wiith
subroutines; the link-loader would create an .exe (executable)
file, to be saved or to be run immediately.

Before the day of "interactive" programming, with was earlier
on some non-IBM systems, the linker would also assign absolute
disk-addresses to data files referenced. Early on, IBM had "JCL"
(Job control language) that helped pass on file references.

>
>Software patches overlay what was already there, using no additional
>space. "Patch in" would imply insertions, requiring adjacent data to be
>moved sideways, and that's not what happens.

--
Rich Ulrich

Tak To

unread,
Sep 23, 2021, 12:54:27 PM9/23/21
to
On 9/20/2021 8:51 AM, Tony Cooper wrote:
> On Mon, 20 Sep 2021 02:06:16 -0700 (PDT), "hongy...@gmail.com"
> <hongy...@gmail.com> wrote:
>
>> The following statement comes from here [1]:
>>
>> A program contains machine language instructions (and some data), usually created by an assembler, and if needed, a compiler. It usually uses a dynamic linker to patch in addresses needed for relocation and handle segment loading, but otherwise is processed directly by the cpu.
>>
>> [1] https://groups.google.com/g/comp.unix.shell/c/S7PeSyYu15E/m/XpmYtFKkCgAJ
>>
>> Can I change the phrase "patch in" into "patch" here?
>
> Not in my opinion.

The "not" in not understandable in relation to what follows...

> To "patch in addresses" means to add addresses at
> the appropriate point. To "patch addresses" means to fix or add
> information to individual addresses.

... unless you think, erroneously, that "to patch in" is the
correct form here.

--
Tak
----------------------------------------------------------------+-----
Tak To ta...@alum.mit.eduxx
--------------------------------------------------------------------^^
[taode takto ~{LU5B~}] NB: trim the xx to get my real email addr





Tak To

unread,
Sep 23, 2021, 1:04:37 PM9/23/21
to
Typically, the machine code contains an offset to which the
linker adds a base to come up with the right address.

> I'm happy to allow that the those addresses are "patched in".

I agree with Peter Moylan in that "to patch in" implies
insertion, which is not the case here.

Tak To

unread,
Sep 23, 2021, 1:12:19 PM9/23/21
to
"Patch in" can be accomplished without "moving sideways" by
changing certain instructions to jumps ...

Tak To

unread,
Sep 23, 2021, 2:34:56 PM9/23/21
to
On 9/22/2021 1:40 AM, Rich Ulrich wrote:
> On Tue, 21 Sep 2021 12:31:54 +1100, Peter Moylan
> <pe...@pmoylan.org.invalid> wrote:
>
>> On 20/09/21 23:51, Tony Cooper wrote:
>>> On Mon, 20 Sep 2021 02:06:16 -0700 (PDT), "hongy...@gmail.com"
>>> <hongy...@gmail.com> wrote:
>>>
>>>> The following statement comes from here [1]:
>>>>
>>>> A program contains machine language instructions (and some data),
>>>> usually created by an assembler, and if needed, a compiler. It
>>>> usually uses a dynamic linker to patch in addresses needed for
>>>> relocation and handle segment loading, but otherwise is processed
>>>> directly by the cpu.
>>>>
>>>> [1]
>>>> https://groups.google.com/g/comp.unix.shell/c/S7PeSyYu15E/m/XpmYtFKkCgAJ
>>>>
>> Can I change the phrase "patch in" into "patch" here?
>>>>
>>>
>>> Not in my opinion. To "patch in addresses" means to add addresses at
>>> the appropriate point. To "patch addresses" means to fix or add
>>> information to individual addresses.
>>
>> I agree with you. From my knowledge of how linkers work, I therefore
>> conclude that "patch" is correct and "patch in" is completely wrong.
>>
>> Software patches overlay what was already there, using no additional
>> space. "Patch in" would imply insertions, requiring adjacent data to be
>> moved sideways, and that's not what happens.
>
> No, "patch in" is the better term.

I am with Peter but acknowledge that there might be different
traditions.

"To patch in" for me by default is what a telephone operator
does, perhaps with actual chords. To patch in a piece of code
one would use jump instructions.

> For a hack, you might "patch" and
> change some legitimate address. To me, "patch" implies a correction,
> a modification of something that otherwise is legitimate.

The action is indeed a correction, thus commonly also
expressed as "to fix up", "to do fixup", etc.

> That is not
> what a dynamic linker does when it fills a reserved spot. It patches
> in the address where the address was expected. In multiple places.

It overwrites an incorrect/invalid address with a correct/
valid one.

> My applications with Fortran would give a linker the name of the
> main program file as a .rel file, and one or more files wiith
> subroutines; the link-loader would create an .exe (executable)
> file, to be saved or to be run immediately.

Linking (linkage editing) is often done in stages.

> Before the day of "interactive" programming, with was earlier
> on some non-IBM systems, the linker would also assign absolute
> disk-addresses to data files referenced. Early on, IBM had "JCL"
> (Job control language) that helped pass on file references.

Disk addresses is an entirely different matter.

Anton Shepelev

unread,
Sep 23, 2021, 5:55:39 PM9/23/21
to
Tony Cooper:

> To "patch in addresses" means to add addresses at the ap-
> propriate point. To "patch addresses" means to fix or
> add information to individual addresses.

In my opinion, the verb `to patch' always implies overlay,
override, and overwrite. Adding preposition `in' or `into'
changes the object from the thing being overwriteen to the
thing that overwirtes it, e.g.:

-- In order to relocate a code section, the linker patch-
es its addresses (with new ones)

-- In order to relocate a code section, the linker patch-
es new addresses into it.

--
() ascii ribbon campaign -- against html e-mail
/\ http://preview.tinyurl.com/qcy6mjc [archived]
0 new messages