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]
Other format: [Raw text]

Re: ld i386 differences 2.10.2 / 2.12


> >   The thing I was trying to do is more:
> > NOCROSSREFS (.extra_text .text);
> > NOCROSSREFS (.text_extra .extra);
> >   to forbid a function F1 in ".text" to call a stub ".extraF2 ->
.textF2"
> >  instead of calling directly the ".text" function F2, considering the
> >  two function F1 and F2 in the ".text" segment, and the stub in the
> >  ".extra_<unprotected>" address space.
> >  This cannot work because I need at least one cross-ref per stub, for
> >  the stub itself.
> 
> Put the stubs in a separate output section.  So sec1 -> stub -> sec2,
> and you can use NOCROSSREFS (sec1, sec2)

 That is what I have already:
  sec1 = .text -> stub = .text_extra -> sec2 = .extra
 and I also have the reverse way:
  sec1 = .extra -> stub = .extra_text -> sec2 = .text
 so the:
  NOCROSSREFS (.text .extra);

 The two sections ".text_extra" and ".extra_text" are completely
 unprotected.
 Note that sections ".text" and ".text_extra" are contigous in the
 same code segment, i.e. register %cs is the same.
 Sections ".extra" and ".extra_text" are contigous in another
 code segment, register %cs is different from ".text" but constant.

 There is only intra-segment calls in between ".text" and ".text_extra",
 and in between ".extra" and ".extra_text", GCC can only manage
 intra-segment calls.

 What I would like is to forbid calls to the wrong stub section, i.e.
 .text -> .extra_text
 and 
 .extra -> .text_extra
 but each stub need one (and only one) reverse reference, the
 real function called by inter-segment instruction:
 .extra_text -> .text
 and 
 .text_extra -> .extra
 So it cannot be done. Note that I am already quite used, when I get
 an invalid instruction exception, to look what is in the same offset
 on the other "%cs" - so that is not so important.

> >  For the ".rel*" sections, because I did not find any option
> >  to at least remove the warnings, I added to my linker file:
> >  ...
> I poked around a little to find where the .rel sections are coming from:
> They're a result of trying to avoid copy relocs when linking with
> dynamic libs.
> ...

 Option "-z nocopyreloc" do not remove the warning, just for info.

 Thanks for your help,
 Etienne.

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com


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