[vbox-dev] VBoxRT.so broken TEXTRELs since 4.3.16

Anna Fischer a.fischer at sirrix.com
Fri Feb 13 17:40:05 GMT 2015


> Betreff: Re: [vbox-dev] VBoxRT.so broken TEXTRELs since 4.3.16
> 
> Hi Anna,
> 
> On Friday 13 February 2015 15:56:48 Anna Fischer wrote:
> > > Betreff: Re: [vbox-dev] VBoxRT.so broken TEXTRELs since 4.3.16
> > >
> > > Anna,
> > >
> > > On Friday 13 February 2015 15:07:39 Frank Mehnert wrote:
> > > > On Friday 13 February 2015 14:37:03 Frank Mehnert wrote:
> > > > > I'm quite sure the -nopie compiler switch of the Gentoo patches
> > > > > is responsible for these TEXTRELs. I didn't find such TEXTRELs
> > > > > in our official packages which you find on www.virtualbox.org. I
> > > > > checked the 64-bit Linux universal .run installer as well as our
> > > > > latest Ubuntu package.
> > > > >
> > > > > 050_virtualbox-4.3.14-nopie.patch from the Gentoo patches adds -
> nopie.
> > > > > That
> > > > > option prevents generating of position-independent code,
> > > > > therefore the .text sections needs to be patched.
> > > > >
> > > > > I propose you ask the Gentoo folks why they add this parameter to gcc.
> > > >
> > > > thinking again -nopie shouldn't be responsible for the TEXTRELS,
> > > > actually this switch should remove the requirement for relocations
> > > > at all. So I guess it's some undesired side effect of this switch.
> > > >
> > > > Which gcc compiler are you using to compile VirtualBox?
> > >
> > > I'm using gcc 4.9.2 on Debian and don't get any of these TEXTRELs
> > > with or without the 050_virtualbox-4.3.14-nopie.patch patch applied.
> > > The other patches can't IMO not be responsible.
> >
> > # gcc --version
> > gcc (Gentoo Hardened 4.8.3 p1.1, pie-0.5.9) 4.8.3 Copyright (C) 2013
> > Free Software Foundation, Inc.
> > This is free software; see the source for copying conditions.  There
> > is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
> PARTICULAR PURPOSE.
> >
> > > Could you send me the actual VBoxRT.so binary by private email?
> > > Unstripped please, taken from the bin/ directory.
> >
> > File attached.
> 
> actually it's not the -nopie parameter but the following patch:
> 
> 008_virtualbox-4.3.14-missing_define.patch
>   https://bugs.gentoo.org/514658
>   https://www.virtualbox.org/ticket/13199
> 
>   --- VirtualBox-4.3.14/src/VBox/Runtime/common/ldr/ldrkStuff.cpp
>   +++ VirtualBox-4.3.14/src/VBox/Runtime/common/ldr/ldrkStuff.cpp
>   @@ -368,7 +368,7 @@
>     * We provide our own based on IPRT instead of using the kLdr ones.
>     */
>    extern "C" const KRDROPS g_kLdrRdrFileOps;
>   -extern "C" const KRDROPS g_kLdrRdrFileOps =
>   +const KRDROPS g_kLdrRdrFileOps __attribute__((section(".rodata"))) =
>    {
>        /* .pszName = */        "IPRT",
>        /* .pNext = */          NULL,
> 
> I don't know why this patch is required but the result is that there will be a
> new small ".rodata" section with "aw" bits defined.
> 
> I don't know why this patch is necessary at all, maybe specific to the other
> Gentoo patches.
> 
> You can try to
> 1) remove that patch at all. If that doesn't compile, do you see the same
>    problem as in the above mentioned ticket 13199? 

Yes, I get the same compiler error. I cannot compile without that patch.

> If that doesn't work,
>    try to
> 2) remove the section(".rodata") attribute. Does that work?

No that doesn't seem to work. I still get the compiler error without that attribute. 





More information about the vbox-dev mailing list