This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

"Create a bfd at linking time"


Hi

  I need to create a bfd at linking time and this bfd conatins several
of its own sections (also created on-the-fly). This is what I did:

__________________________________________________________

 bfd * abfd;
 lang_input_statement_type *p;

 // Create my bfd
 abfd = create_my_own_bfd();

 // Insert into input_file_chain
 p = lang_add_input_file("dummy", lang_input_file_is_fake_enum, NULL);
 p -> the_bfd = abfd;

 // Insert into the `output' file_chain
 ldlang_add_file (p);
_________________________________________________________

 In general, is this a correct way to add a bfd into the statement list?

 However, at the final linking step,  _bfd_generic_final_link(),
there is an error message: bfd_error_system_call.

 One potential problem is that I did not set the 'link_order_header' and
'link_order_tail' fields when creating the sections within the bfd.
How to set these two fields when creating a new section?

Thanks

-- 
Dr. Xinan Tang                    Member of Technical Staff
EMail: xinant@cognigine.com  	  Cognigine Corp.
Voice: 510.743.4930               6120 Stevenson Boulevard
Fax:   510.743.4910               Fremont, CA  94538


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]