Ard,

OK.But when a simple HelloWorld program,which is part of EDK2 sample programs and which is written in c,is renamed to .CPP,we get these relocation issues in-spite of not using any C++ runtime API's.

Thanks.

On Thu, Jan 14, 2016 at 2:39 PM, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
On 14 January 2016 at 10:06, Ravikanth MVR <ravikanth.mvr@avagotech.com> wrote:
> Hi Ard,
>
> Hope you remember we speaking about the 0x105 and 0x0 relocation issues
> which we came across while compiling a simple HelloWorld program in CPP.As
> you said on the other thread(EDK2 mailing list)we need some changes to
> compiler and GenFw utility of UDK,can we take the required changes forward
> and come up with a UDK with this support?
>
> We are stuck at this juncture with this activity and would need your help
> badly.
>

Please forget about UDK, and rebase your work onto the latest EDK2
master branch. There have been many changes to the way relocations are
handled, which also impose requirements at link time (i.e., in terms
of section alignment, and relative offset between sections both in the
ELF and the PE/COFF versions of the image)

However, the relocation issue was due to the fact that you were using
the Linux version of the C++ runtime, which you cannot use under EDK2
even if we do support those relocation types with the newer tools.

Bottom line is that you need to develop your own C++ minimal runtime
if you want to run C++ programs under EDK2

> On Tue, Jan 5, 2016 at 4:29 PM, Ravikanth MVR <ravikanth.mvr@avagotech.com>
> wrote:
>>
>> +Sada.
>>
>> Thanks.
>>
>> On Wed, Dec 30, 2015 at 8:38 PM, Ard Biesheuvel
>> <ard.biesheuvel@linaro.org> wrote:
>>>
>>> On 30 December 2015 at 16:02, Leif Lindholm <leif.lindholm@linaro.org>
>>> wrote:
>>> > Hi Daniel,
>>> >
>>> > Sorry, your email got stuck in my SPAM folder for some reason.
>>> >
>>> > On Wed, Dec 23, 2015 at 05:25:21PM -0500, Daniel Samuelraj wrote:
>>> >> We are able to compile CPP files for X64 using UDK2014 by using Visual
>>> >> Studio.
>>> >>
>>> >> How do we compile the same source for AARCH64?
>>>
>>> Do you mean C++? That is completely unsupported, and is going to be
>>> quite a challenge to implement. Note that you cannot rely on the C++
>>> runtime for various reasons (including, but not limited to, the fact
>>> that it uses small model relocations, and is built against libc on
>>> Linux) I wonder how that even works on Visual Studio for X64, since
>>> the code you build will try to call libc functions from the VC runtime
>>> library.
>>>
>>> There has been some discussion about this recently on the list. If you
>>> disable exceptions and RTTI, and reimplement your new and delete
>>> operators, you may be able to build code that does not rely on
>>> advanced C++ runtime features.
>>>
>>> --
>>> Ard.
>>
>>
>