Not a missing option — an inverted default, and the only one of this group that can corrupt storage across address spaces rather than within one module.
What ld370 does
The PDS2 user-data template is hardcoded (ld370.c:732-734):
static const unsigned char unload_userdata[24] = {
0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xf2, 0x00, 0x00,
0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x01, 0x00, 0x00 };
ud[8] = 0xC3 is PDS2RENT (0x80) | PDS2REUS (0x40) | PDS2EXEC (0x02) | PDS21BLK (0x01). build_userdata only ever clears those bits (:952-953):
if (no_rent) ud[8] = (unsigned char)(ud[8] & ~0x80); /* clear PDS2RENT */
if (no_reus) ud[8] = (unsigned char)(ud[8] & ~0x40); /* clear PDS2REUS */
There is no path that sets them conditionally. Every module ld370 links is marked reentrant and reusable unless the caller remembers --norent / --noreus. The TODO(generalise) above the template already notes the attributes are echoed from one member's values rather than computed.
What IEWL does
HEWLFINT clears the attribute bytes before PARM processing (NI PDSE7,ZERO / NI PDSE8,ZERO, with ZERO EQU 0) and only then sets the 44K/DC bits. RENT/REUS are set exclusively from the option table when the PARM says so. IEWL's default is neither reentrant nor reusable. Citations in docs/ld370-iewl-divergences.md.
Why this is a defect and not a preference
RENT is not a label, it is a promise the loader acts on: a module marked reentrant may be placed in the LPA and shared across address spaces, so a false RENT on a module with modifiable storage is cross-user corruption. rexx370 already needs --norent (the comment at ld370.c:52-57 says so), which shows the case is live — today it depends on somebody remembering the flag per module, and the failure mode for forgetting is silent.
Fix
Invert the default: clear RENT|REUS in the template, add --rent / --reus to set them, matching IEWL. If that breaks callers relying on today's behaviour, the interim step is to keep the default but require an explicit --rent/--norent decision and fail without one.
REFR is another PDS2ATR1 bit with no control at all, and is worth four lines if this code is being touched anyway.
Note for whoever picks this up
This also explains the adjacent observation in #37 (--norent produced a byte-identical module, and the reporter could not tell whether the flag was ignored): build_userdata() is reached only from emit_unload, so the attributes exist only in the directory entry of an -iebcopy / -xmit / --pack output. A bare -o OUT member carries no attributes at all, and is byte-identical with and without the flag by construction. Confirm on the -iebcopy output before closing that half of #37.
Not a missing option — an inverted default, and the only one of this group that can corrupt storage across address spaces rather than within one module.
What ld370 does
The PDS2 user-data template is hardcoded (
ld370.c:732-734):ud[8] = 0xC3isPDS2RENT (0x80) | PDS2REUS (0x40) | PDS2EXEC (0x02) | PDS21BLK (0x01).build_userdataonly ever clears those bits (:952-953):There is no path that sets them conditionally. Every module ld370 links is marked reentrant and reusable unless the caller remembers
--norent/--noreus. TheTODO(generalise)above the template already notes the attributes are echoed from one member's values rather than computed.What IEWL does
HEWLFINTclears the attribute bytes before PARM processing (NI PDSE7,ZERO/NI PDSE8,ZERO, withZERO EQU 0) and only then sets the 44K/DC bits.RENT/REUSare set exclusively from the option table when the PARM says so. IEWL's default is neither reentrant nor reusable. Citations indocs/ld370-iewl-divergences.md.Why this is a defect and not a preference
RENT is not a label, it is a promise the loader acts on: a module marked reentrant may be placed in the LPA and shared across address spaces, so a false RENT on a module with modifiable storage is cross-user corruption. rexx370 already needs
--norent(the comment atld370.c:52-57says so), which shows the case is live — today it depends on somebody remembering the flag per module, and the failure mode for forgetting is silent.Fix
Invert the default: clear RENT|REUS in the template, add
--rent/--reusto set them, matching IEWL. If that breaks callers relying on today's behaviour, the interim step is to keep the default but require an explicit--rent/--norentdecision and fail without one.REFRis anotherPDS2ATR1bit with no control at all, and is worth four lines if this code is being touched anyway.Note for whoever picks this up
This also explains the adjacent observation in #37 (
--norentproduced a byte-identical module, and the reporter could not tell whether the flag was ignored):build_userdata()is reached only fromemit_unload, so the attributes exist only in the directory entry of an-iebcopy/-xmit/--packoutput. A bare-o OUTmember carries no attributes at all, and is byte-identical with and without the flag by construction. Confirm on the-iebcopyoutput before closing that half of #37.