[vbox-dev] VBoxRT.so broken TEXTRELs since 4.3.16
frank.mehnert at oracle.com
Fri Feb 13 16:49:48 UTC 2015
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:
@@ -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? If that doesn't work,
2) remove the section(".rodata") attribute. Does that work?
Dr.-Ing. Frank Mehnert | Software Development Director, VirtualBox
ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | 71384 Weinstadt, Germany
Hauptverwaltung: Riesstr. 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603
Geschäftsführer: Jürgen Kunz
Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Astrid Kepper, Val Maher
More information about the vbox-dev