File tree 1 file changed +8
-2
lines changed
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 {
132
132
let init_array_section =
133
133
self . object
134
134
. 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 ( ) ;
135
141
self . object . append_section_data (
136
142
init_array_section,
137
143
& std:: iter:: repeat ( 0 )
138
- . take ( 8 /*FIXME pointer size*/ )
144
+ . take ( address_size . into ( ) )
139
145
. collect :: < Vec < u8 > > ( ) ,
140
146
8 ,
141
147
) ;
@@ -144,7 +150,7 @@ impl AddConstructor for ObjectProduct {
144
150
init_array_section,
145
151
object:: write:: Relocation {
146
152
offset : 0 ,
147
- size : 64 , // FIXME pointer size
153
+ size : address_size * 8 ,
148
154
kind : RelocationKind :: Absolute ,
149
155
encoding : RelocationEncoding :: Generic ,
150
156
symbol,
You can’t perform that action at this time.
0 commit comments