Class: Rubycc::IR::GlobalReloc
- Inherits:
-
Data
- Object
- Data
- Rubycc::IR::GlobalReloc
- Defined in:
- lib/rubycc/ir/ir.rb
Overview
One relocation inside a global's .data image. offset is the byte offset
of the 8-byte pointer slot within that global. kind is :symbol for the
address of another file-scope object — symbol names it, resolved as an
absolute 64-bit address (a "&global" or a decayed global array) — or
:string for a string literal, where string_id indexes the translation
unit's string pool and the compiler resolves it to a .rodata offset. The
unused field is nil for each kind. addend is a constant byte displacement
added to the base address (0 for a bare "&global" or string, non-zero for a
computed address constant such as "&arr", "arr + n" or "&rec.member");
it becomes the R_X86_64_64 relocation's r_addend.
Instance Attribute Summary collapse
-
#addend ⇒ Object
readonly
Returns the value of attribute addend.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#string_id ⇒ Object
readonly
Returns the value of attribute string_id.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
Instance Method Summary collapse
-
#initialize(offset:, kind:, symbol:, string_id:, addend: 0) ⇒ GlobalReloc
constructor
A new instance of GlobalReloc.
Constructor Details
#initialize(offset:, kind:, symbol:, string_id:, addend: 0) ⇒ GlobalReloc
Returns a new instance of GlobalReloc.
387 388 389 |
# File 'lib/rubycc/ir/ir.rb', line 387 def initialize(offset:, kind:, symbol:, string_id:, addend: 0) super end |
Instance Attribute Details
#addend ⇒ Object (readonly)
Returns the value of attribute addend
386 387 388 |
# File 'lib/rubycc/ir/ir.rb', line 386 def addend @addend end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind
386 387 388 |
# File 'lib/rubycc/ir/ir.rb', line 386 def kind @kind end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset
386 387 388 |
# File 'lib/rubycc/ir/ir.rb', line 386 def offset @offset end |
#string_id ⇒ Object (readonly)
Returns the value of attribute string_id
386 387 388 |
# File 'lib/rubycc/ir/ir.rb', line 386 def string_id @string_id end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol
386 387 388 |
# File 'lib/rubycc/ir/ir.rb', line 386 def symbol @symbol end |