This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

Re: [vms/committed]: Handle LIB$INITIALIZE


On Jun 1, 2010, at 1:54 PM, h.becker wrote:

> Tristan Gingold wrote:
> 
>> +       /* Only put in the GSD the global and the undefined symbols.  */
>>        if (old_flags & BSF_FILE)
>>  	continue;
>>  !       if ((old_flags & BSF_GLOBAL) == 0 && !bfd_is_und_section (symbol->section))
>> !         {
>> !           /* If the LIB$INITIIALIZE section is present, add a reference to
>> !              LIB$INITIALIZE symbol.  FIXME: this should be done explicitely
>> !              in the assembly file.  */
>> !           if (!((old_flags & BSF_SECTION_SYM) != 0
>> !                 && strcmp (symbol->section->name, "LIB$INITIALIZE") == 0))
>> !             continue;
>> !         }
> 
> Regarding image initialization, the presence of a LIB$INITIIALIZE PSECT doesn't do anything, especially it does not result in adding a reference to the LIB$INITIALIZE symbol. Image initialization with LIB$INITIALIZE doesn't work that way.

Yes, I know and that's the reason of the 'FIXME' here.  Maybe I should have expanded the comment a little
bit more:  there is currently no direct way in the assembler to mark a symbol as extern, ie creating a
reference to it.  I left this work-around as is, but yes I plan to fix that later.

>> +   /* Set transfer addresses.  */
>> +   {
>> +     int i;
>> +     struct bfd_link_hash_entry *h;
>> + +     i = 0;
>> +     PRIV (transfer_address[i++]) = 0xffffffff00000340;	/* SYS$IMGACT */
>> +     h = bfd_link_hash_lookup (info->hash, "LIB$INITIALIZE", FALSE, FALSE, TRUE);
>> +     if (h != NULL && h->type == bfd_link_hash_defined)
>> +       PRIV (transfer_address[i++]) =
>> +         alpha_vms_get_sym_value (h->u.def.section, h->u.def.value);
>> +     PRIV (transfer_address[i++]) = bfd_get_start_address (abfd);
>> +     while (i < 4)
>> +       PRIV (transfer_address[i++]) = 0;
>> +   }
>> + 
> 
> I would add a FIXME or ADDME, here. But it depends whether you want to support linking /NOTRACEBACK or not.

Yes, this is in the TODO list.

> 
>> +   /* FIXME: we should place sections by VMS program section flags.  */
>> + 
> 
> Hmm, do you mean according to the tables in the VMS linker manual?  Then you also want to place by target type: for shareable images SHR becomes important.

No, I don't plan to clustering as described in the VMS linker manual as this work is done in GNU ld by
the linker script.  But the algorithm currently used to place orphan sections is too crude now.

Tristan.


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