File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,20 +31,21 @@ func RELRO(name string) *relro {
3131 return & res
3232 }
3333
34- // check both bind and bind_flag .
34+ // check both bind and flags .
3535 // if DT_BIND_NOW == 0, then it is set
36- // if DT_FLAGS == 8 , then DF_BIND_NOW is set
36+ // if ( DT_FLAGS & 0x8) > 0 , then DF_BIND_NOW is set
3737 // this is depending on the compiler version used.
3838 bind , _ := file .DynValue (elf .DT_BIND_NOW )
3939 if len (bind ) == 0 {
4040 bind , _ = DynValueFromPTDynamic (file , elf .DT_BIND_NOW )
4141 }
42- bind_flag , _ := file .DynValue (elf .DT_FLAGS )
43- if len (bind_flag ) == 0 {
44- bind_flag , _ = DynValueFromPTDynamic (file , elf .DT_FLAGS )
42+ flags , _ := file .DynValue (elf .DT_FLAGS )
43+ if len (flags ) == 0 {
44+ flags , _ = DynValueFromPTDynamic (file , elf .DT_FLAGS )
4545 }
4646
47- if (len (bind ) > 0 && bind [0 ] == 0 ) || (len (bind_flag ) > 0 && bind_flag [0 ] == 8 ) {
47+ const DF_BIND_NOW = 0x8
48+ if (len (bind ) > 0 && bind [0 ] == 0 ) || (len (flags ) > 0 && (flags [0 ] & DF_BIND_NOW ) > 0 ) {
4849 bindNow = true
4950 }
5051
You can’t perform that action at this time.
0 commit comments