File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -132,10 +132,16 @@ impl AddConstructor for ObjectProduct {
132132 let init_array_section =
133133 self . object
134134 . add_section ( segment. to_vec ( ) , b".init_array" . to_vec ( ) , SectionKind :: Data ) ;
135+ let address_size = self
136+ . object
137+ . architecture ( )
138+ . address_size ( )
139+ . expect ( "address_size must be known" )
140+ . bytes ( ) ;
135141 self . object . append_section_data (
136142 init_array_section,
137143 & std:: iter:: repeat ( 0 )
138- . take ( 8 /*FIXME pointer size*/ )
144+ . take ( address_size . into ( ) )
139145 . collect :: < Vec < u8 > > ( ) ,
140146 8 ,
141147 ) ;
@@ -144,7 +150,7 @@ impl AddConstructor for ObjectProduct {
144150 init_array_section,
145151 object:: write:: Relocation {
146152 offset : 0 ,
147- size : 64 , // FIXME pointer size
153+ size : address_size * 8 ,
148154 kind : RelocationKind :: Absolute ,
149155 encoding : RelocationEncoding :: Generic ,
150156 symbol,
You can’t perform that action at this time.
0 commit comments