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.