@@ -89,7 +89,7 @@ pub const DynamicSection = struct {
89
89
if (elf_file .verneed_section_index != null ) nentries += 2 ; // VERNEED
90
90
if (dt .getFlags (elf_file ) != null ) nentries += 1 ; // FLAGS
91
91
if (dt .getFlags1 (elf_file ) != null ) nentries += 1 ; // FLAGS_1
92
- if (! elf_file .base . isDynLib ()) nentries += 1 ; // DEBUG
92
+ if (! elf_file .isEffectivelyDynLib ()) nentries += 1 ; // DEBUG
93
93
nentries += 1 ; // NULL
94
94
return nentries * @sizeOf (elf .Elf64_Dyn );
95
95
}
@@ -216,7 +216,7 @@ pub const DynamicSection = struct {
216
216
}
217
217
218
218
// DEBUG
219
- if (! elf_file .base . isDynLib ()) try writer .writeStruct (elf.Elf64_Dyn { .d_tag = elf .DT_DEBUG , .d_val = 0 });
219
+ if (! elf_file .isEffectivelyDynLib ()) try writer .writeStruct (elf.Elf64_Dyn { .d_tag = elf .DT_DEBUG , .d_val = 0 });
220
220
221
221
// NULL
222
222
try writer .writeStruct (elf.Elf64_Dyn { .d_tag = elf .DT_NULL , .d_val = 0 });
@@ -256,7 +256,7 @@ pub const ZigGotSection = struct {
256
256
entry .* = sym_index ;
257
257
const symbol = elf_file .symbol (sym_index );
258
258
symbol .flags .has_zig_got = true ;
259
- if (elf_file .base . isDynLib () or (elf_file .base .isExe () and comp .config .pie )) {
259
+ if (elf_file .isEffectivelyDynLib () or (elf_file .base .isExe () and comp .config .pie )) {
260
260
zig_got .flags .needs_rela = true ;
261
261
}
262
262
if (symbol .extra (elf_file )) | extra | {
@@ -495,7 +495,7 @@ pub const GotSection = struct {
495
495
const symbol = elf_file .symbol (sym_index );
496
496
symbol .flags .has_got = true ;
497
497
if (symbol .flags .import or symbol .isIFunc (elf_file ) or
498
- ((elf_file .base . isDynLib () or (elf_file .base .isExe () and comp .config .pie )) and ! symbol .isAbs (elf_file )))
498
+ ((elf_file .isEffectivelyDynLib () or (elf_file .base .isExe () and comp .config .pie )) and ! symbol .isAbs (elf_file )))
499
499
{
500
500
got .flags .needs_rela = true ;
501
501
}
@@ -528,7 +528,7 @@ pub const GotSection = struct {
528
528
entry .symbol_index = sym_index ;
529
529
const symbol = elf_file .symbol (sym_index );
530
530
symbol .flags .has_tlsgd = true ;
531
- if (symbol .flags .import or elf_file .base . isDynLib ()) got .flags .needs_rela = true ;
531
+ if (symbol .flags .import or elf_file .isEffectivelyDynLib ()) got .flags .needs_rela = true ;
532
532
if (symbol .extra (elf_file )) | extra | {
533
533
var new_extra = extra ;
534
534
new_extra .tlsgd = index ;
@@ -545,7 +545,7 @@ pub const GotSection = struct {
545
545
entry .symbol_index = sym_index ;
546
546
const symbol = elf_file .symbol (sym_index );
547
547
symbol .flags .has_gottp = true ;
548
- if (symbol .flags .import or elf_file .base . isDynLib ()) got .flags .needs_rela = true ;
548
+ if (symbol .flags .import or elf_file .isEffectivelyDynLib ()) got .flags .needs_rela = true ;
549
549
if (symbol .extra (elf_file )) | extra | {
550
550
var new_extra = extra ;
551
551
new_extra .gottp = index ;
@@ -580,7 +580,7 @@ pub const GotSection = struct {
580
580
581
581
pub fn write (got : GotSection , elf_file : * Elf , writer : anytype ) ! void {
582
582
const comp = elf_file .base .comp ;
583
- const is_dyn_lib = elf_file .base . isDynLib ();
583
+ const is_dyn_lib = elf_file .isEffectivelyDynLib ();
584
584
const apply_relocs = true ; // TODO add user option for this
585
585
586
586
for (got .entries .items ) | entry | {
@@ -595,7 +595,7 @@ pub const GotSection = struct {
595
595
if (symbol .? .flags .import ) break :blk 0 ;
596
596
if (symbol .? .isIFunc (elf_file ))
597
597
break :blk if (apply_relocs ) value else 0 ;
598
- if ((elf_file .base . isDynLib () or (elf_file .base .isExe () and comp .config .pie )) and
598
+ if ((elf_file .isEffectivelyDynLib () or (elf_file .base .isExe () and comp .config .pie )) and
599
599
! symbol .? .isAbs (elf_file ))
600
600
{
601
601
break :blk if (apply_relocs ) value else 0 ;
@@ -653,7 +653,7 @@ pub const GotSection = struct {
653
653
pub fn addRela (got : GotSection , elf_file : * Elf ) ! void {
654
654
const comp = elf_file .base .comp ;
655
655
const gpa = comp .gpa ;
656
- const is_dyn_lib = elf_file .base . isDynLib ();
656
+ const is_dyn_lib = elf_file .isEffectivelyDynLib ();
657
657
const cpu_arch = elf_file .getTarget ().cpu .arch ;
658
658
try elf_file .rela_dyn .ensureUnusedCapacity (gpa , got .numRela (elf_file ));
659
659
@@ -683,7 +683,7 @@ pub const GotSection = struct {
683
683
});
684
684
continue ;
685
685
}
686
- if ((elf_file .base . isDynLib () or (elf_file .base .isExe () and comp .config .pie )) and
686
+ if ((elf_file .isEffectivelyDynLib () or (elf_file .base .isExe () and comp .config .pie )) and
687
687
! symbol .? .isAbs (elf_file ))
688
688
{
689
689
elf_file .addRelaDynAssumeCapacity (.{
@@ -758,7 +758,7 @@ pub const GotSection = struct {
758
758
759
759
pub fn numRela (got : GotSection , elf_file : * Elf ) usize {
760
760
const comp = elf_file .base .comp ;
761
- const is_dyn_lib = elf_file .base . isDynLib ();
761
+ const is_dyn_lib = elf_file .isEffectivelyDynLib ();
762
762
var num : usize = 0 ;
763
763
for (got .entries .items ) | entry | {
764
764
const symbol = switch (entry .tag ) {
@@ -767,7 +767,7 @@ pub const GotSection = struct {
767
767
};
768
768
switch (entry .tag ) {
769
769
.got = > if (symbol .? .flags .import or symbol .? .isIFunc (elf_file ) or
770
- ((elf_file .base . isDynLib () or (elf_file .base .isExe () and comp .config .pie )) and
770
+ ((elf_file .isEffectivelyDynLib () or (elf_file .base .isExe () and comp .config .pie )) and
771
771
! symbol .? .isAbs (elf_file )))
772
772
{
773
773
num += 1 ;
0 commit comments