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: RFC: should objcopy convert .rel.* to .rela and back?


Hi Alexey,

> [Resend due to no response]

Sorry for our failure to respond previously.


> The objcopy command above, however, does not change the format of the relocation sections: the resulting output.o, despite being an x86-64 object, contains .rel.* sections.
 
> 1. Should objcopy have an ability to convert .rel.* to .rela.* and back? 

Eww - well I suppose that it could, but I think that it might not do what you want.
You see the issue is not only that the type of the relocs is different, but also that
the relocs themselves are have different values (when comparing x86 and x86_64).  So
you cannot just change the type, you also need to look at each reloc and possibly
change its type, its offset, and maybe other things too.  

Basically I am saying that it is likely to be bug-prone...


> 2. Shouldn't ld detect that it must update the addends and has no way to do so?

Well if it can, then yes.  But I am not sure that the linker will be able to detect
this situation.  If you give it files that violate the ABI and lie about the 
architecture type that they support, then you are going to have problems.

If however you have a patch that you would like us to consider, I will be happy
to review it.

Cheers
  Nick


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