NDK r8c linker warnings for asm files from libx264

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

NDK r8c linker warnings for asm files from libx264

Alex Cohn
With NDK r8c, linking of X264 encoder (on Mac OS, if that matters) issues warnings:

cannot scan executable section 1 of libx264.a(dct-a.o) for Cortex-A8 erratum because it has no mapping symbols

... same warning for all assembly files in libx264.

libx264.a itself was cross-compiled on the same Mac with the same 4.6 toolchain taken from NDK. Is it a problem with the new linker, or with the assembler that produced dct-a.o from dct-a.S, or with our configuration?

Sincerely,
Alex

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/old7pyBxCKgJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: NDK r8c linker warnings for asm files from libx264

Doug Kwan (關振德)
For the Cortex-A8 hardware erratum, the linker needs to rewrite
certain instructions that may trigger the hardware bug.  To that
reliably, the linker needs to know whether a location contains an ARM
instruction,a THUMB instruction or a piece of data.  The mapping
symbol is inserted to by the assembly for that purpose.  Without these
mapping symbol, the linker cannot apply the workaround.



On Sun, Dec 2, 2012 at 7:51 AM, Alex Cohn <[hidden email]> wrote:

> With NDK r8c, linking of X264 encoder (on Mac OS, if that matters) issues
> warnings:
>
> cannot scan executable section 1 of libx264.a(dct-a.o) for Cortex-A8 erratum
> because it has no mapping symbols
>
> ... same warning for all assembly files in libx264.
>
> libx264.a itself was cross-compiled on the same Mac with the same 4.6
> toolchain taken from NDK. Is it a problem with the new linker, or with the
> assembler that produced dct-a.o from dct-a.S, or with our configuration?
>
> Sincerely,
> Alex
>
> --
> You received this message because you are subscribed to the Google Groups
> "android-ndk" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/android-ndk/-/old7pyBxCKgJ.
> To post to this group, send email to [hidden email].
> To unsubscribe from this group, send email to
> [hidden email].
> For more options, visit this group at
> http://groups.google.com/group/android-ndk?hl=en.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: NDK r8c linker warnings for asm files from libx264

Alex Cohn-2
On Mon, Dec 3, 2012 at 8:36 AM, Doug Kwan (關振德) <[hidden email]> wrote:
For the Cortex-A8 hardware erratum, the linker needs to rewrite
certain instructions that may trigger the hardware bug.  To that
reliably, the linker needs to know whether a location contains an ARM
instruction,a THUMB instruction or a piece of data.  The mapping
symbol is inserted to by the assembly for that purpose.  Without these
mapping symbol, the linker cannot apply the workaround.
 
Thanks, I know the theory. My problem is that I could not find how to modify the x264 ARM assembly files to would satisfy the r8c linker. Note that we did not see this warning with r8b linker.

Alex

On Sun, Dec 2, <a href="tel:2012" value="+9722012">2012 at 7:51 AM, Alex Cohn <[hidden email]> wrote:
> With NDK r8c, linking of X264 encoder (on Mac OS, if that matters) issues
> warnings:
>
> cannot scan executable section 1 of libx264.a(dct-a.o) for Cortex-A8 erratum
> because it has no mapping symbols
>
> ... same warning for all assembly files in libx264.
>
> libx264.a itself was cross-compiled on the same Mac with the same 4.6
> toolchain taken from NDK. Is it a problem with the new linker, or with the
> assembler that produced dct-a.o from dct-a.S, or with our configuration?
>
> Sincerely,
> Alex
>
> --
> You received this message because you are subscribed to the Google Groups
> "android-ndk" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/android-ndk/-/old7pyBxCKgJ.
> To post to this group, send email to [hidden email].
> To unsubscribe from this group, send email to
> [hidden email].
> For more options, visit this group at
> http://groups.google.com/group/android-ndk?hl=en.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.


--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: NDK r8c linker warnings for asm files from libx264

Doug Kwan (關振德)
Do have detail instructions for reproducing this problem?

On Mon, Dec 3, 2012 at 1:33 AM, Alex Cohn <[hidden email]> wrote:

> On Mon, Dec 3, 2012 at 8:36 AM, Doug Kwan (關振德) <[hidden email]> wrote:
>>
>> For the Cortex-A8 hardware erratum, the linker needs to rewrite
>> certain instructions that may trigger the hardware bug.  To that
>> reliably, the linker needs to know whether a location contains an ARM
>> instruction,a THUMB instruction or a piece of data.  The mapping
>> symbol is inserted to by the assembly for that purpose.  Without these
>> mapping symbol, the linker cannot apply the workaround.
>
>
> Thanks, I know the theory. My problem is that I could not find how to modify
> the x264 ARM assembly files to would satisfy the r8c linker. Note that we
> did not see this warning with r8b linker.
>
> Alex
>
>> On Sun, Dec 2, 2012 at 7:51 AM, Alex Cohn <[hidden email]> wrote:
>> > With NDK r8c, linking of X264 encoder (on Mac OS, if that matters)
>> > issues
>> > warnings:
>> >
>> > cannot scan executable section 1 of libx264.a(dct-a.o) for Cortex-A8
>> > erratum
>> > because it has no mapping symbols
>> >
>> > ... same warning for all assembly files in libx264.
>> >
>> > libx264.a itself was cross-compiled on the same Mac with the same 4.6
>> > toolchain taken from NDK. Is it a problem with the new linker, or with
>> > the
>> > assembler that produced dct-a.o from dct-a.S, or with our configuration?
>> >
>> > Sincerely,
>> > Alex
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "android-ndk" group.
>> > To view this discussion on the web visit
>> > https://groups.google.com/d/msg/android-ndk/-/old7pyBxCKgJ.
>> > To post to this group, send email to [hidden email].
>> > To unsubscribe from this group, send email to
>> > [hidden email].
>> > For more options, visit this group at
>> > http://groups.google.com/group/android-ndk?hl=en.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "android-ndk" group.
>> To post to this group, send email to [hidden email].
>> To unsubscribe from this group, send email to
>> [hidden email].
>> For more options, visit this group at
>> http://groups.google.com/group/android-ndk?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "android-ndk" group.
> To post to this group, send email to [hidden email].
> To unsubscribe from this group, send email to
> [hidden email].
> For more options, visit this group at
> http://groups.google.com/group/android-ndk?hl=en.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: NDK r8c linker warnings for asm files from libx264

Alex Cohn-2
On Mon, Dec 3, 2012 at 8:36 PM, Doug Kwan (關振德) <[hidden email]> wrote:
> Do have detail instructions for reproducing this problem?

1. Download x264-snapshot-20121203-2245 from
ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2

2. Run ./configure --enable-pic --enable-strip --enable-static
--cross-prefix=~/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-
--sysroot=~/android-ndk-r8c/platforms/android-14/arch-arm
--host=arm-linux

3. Run ~/android-ndk-r8c/prebuilt/linux-x86/bin/make

It will build the static library, and after that display the Cortex-A8
warning while linking the x265 executable. I am not worried about the
compiler warnings, because building libx264.a is done offline, it is
not part of our official daily build.

Actually, I would first of all want to know: what is the meaning of
this warning? If there are no real-life consequences, I can live with
it for a while... But I am concerned with what will happen if our
program gets loaded on one of the faulty chips.

BTW, I have reproduced the result on Ubuntu, so it is not Mac-specific.

Thanks,
Alex

> On Mon, Dec 3, 2012 at 1:33 AM, Alex Cohn <[hidden email]> wrote:
>> On Mon, Dec 3, 2012 at 8:36 AM, Doug Kwan (關振德) <[hidden email]> wrote:
>>>
>>> For the Cortex-A8 hardware erratum, the linker needs to rewrite
>>> certain instructions that may trigger the hardware bug.  To that
>>> reliably, the linker needs to know whether a location contains an ARM
>>> instruction,a THUMB instruction or a piece of data.  The mapping
>>> symbol is inserted to by the assembly for that purpose.  Without these
>>> mapping symbol, the linker cannot apply the workaround.
>>
>>
>> Thanks, I know the theory. My problem is that I could not find how to modify
>> the x264 ARM assembly files to would satisfy the r8c linker. Note that we
>> did not see this warning with r8b linker.
>>
>> Alex
>>
>>> On Sun, Dec 2, 2012 at 7:51 AM, Alex Cohn <[hidden email]> wrote:
>>> > With NDK r8c, linking of X264 encoder (on Mac OS, if that matters)
>>> > issues
>>> > warnings:
>>> >
>>> > cannot scan executable section 1 of libx264.a(dct-a.o) for Cortex-A8
>>> > erratum
>>> > because it has no mapping symbols
>>> >
>>> > ... same warning for all assembly files in libx264.
>>> >
>>> > libx264.a itself was cross-compiled on the same Mac with the same 4.6
>>> > toolchain taken from NDK. Is it a problem with the new linker, or with
>>> > the
>>> > assembler that produced dct-a.o from dct-a.S, or with our configuration?
>>> >
>>> > Sincerely,
>>> > Alex
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> > Groups
>>> > "android-ndk" group.
>>> > To view this discussion on the web visit
>>> > https://groups.google.com/d/msg/android-ndk/-/old7pyBxCKgJ.
>>> > To post to this group, send email to [hidden email].
>>> > To unsubscribe from this group, send email to
>>> > [hidden email].
>>> > For more options, visit this group at
>>> > http://groups.google.com/group/android-ndk?hl=en.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "android-ndk" group.
>>> To post to this group, send email to [hidden email].
>>> To unsubscribe from this group, send email to
>>> [hidden email].
>>> For more options, visit this group at
>>> http://groups.google.com/group/android-ndk?hl=en.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "android-ndk" group.
>> To post to this group, send email to [hidden email].
>> To unsubscribe from this group, send email to
>> [hidden email].
>> For more options, visit this group at
>> http://groups.google.com/group/android-ndk?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.
> To post to this group, send email to [hidden email].
> To unsubscribe from this group, send email to [hidden email].
> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: NDK r8c linker warnings for asm files from libx264

Doug Kwan (關振德)
Thanks for the instructions.

The warning means that gold cannot tell what kind of bits
(data/arm/thumb) a section contains and thus it would skip fixing up
the section for the cortex-A8 erratum workaround.  In the very
unlikely event that your code runs on an early cortex-A8 core with
that hardware bug, bad things can happen.  Applying the fix requires
changing instructions so the linker has to be absolutely sure that it
is dealing with THUMB-2 instructions at locations where it is looking
for this bug.

-Doug

On Thu, Dec 6, 2012 at 3:46 PM, Alex Cohn <[hidden email]> wrote:

> On Mon, Dec 3, 2012 at 8:36 PM, Doug Kwan (關振德) <[hidden email]> wrote:
>> Do have detail instructions for reproducing this problem?
>
> 1. Download x264-snapshot-20121203-2245 from
> ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
>
> 2. Run ./configure --enable-pic --enable-strip --enable-static
> --cross-prefix=~/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-
> --sysroot=~/android-ndk-r8c/platforms/android-14/arch-arm
> --host=arm-linux
>
> 3. Run ~/android-ndk-r8c/prebuilt/linux-x86/bin/make
>
> It will build the static library, and after that display the Cortex-A8
> warning while linking the x265 executable. I am not worried about the
> compiler warnings, because building libx264.a is done offline, it is
> not part of our official daily build.
>
> Actually, I would first of all want to know: what is the meaning of
> this warning? If there are no real-life consequences, I can live with
> it for a while... But I am concerned with what will happen if our
> program gets loaded on one of the faulty chips.
>
> BTW, I have reproduced the result on Ubuntu, so it is not Mac-specific.
>
> Thanks,
> Alex
>
>> On Mon, Dec 3, 2012 at 1:33 AM, Alex Cohn <[hidden email]> wrote:
>>> On Mon, Dec 3, 2012 at 8:36 AM, Doug Kwan (關振德) <[hidden email]> wrote:
>>>>
>>>> For the Cortex-A8 hardware erratum, the linker needs to rewrite
>>>> certain instructions that may trigger the hardware bug.  To that
>>>> reliably, the linker needs to know whether a location contains an ARM
>>>> instruction,a THUMB instruction or a piece of data.  The mapping
>>>> symbol is inserted to by the assembly for that purpose.  Without these
>>>> mapping symbol, the linker cannot apply the workaround.
>>>
>>>
>>> Thanks, I know the theory. My problem is that I could not find how to modify
>>> the x264 ARM assembly files to would satisfy the r8c linker. Note that we
>>> did not see this warning with r8b linker.
>>>
>>> Alex
>>>
>>>> On Sun, Dec 2, 2012 at 7:51 AM, Alex Cohn <[hidden email]> wrote:
>>>> > With NDK r8c, linking of X264 encoder (on Mac OS, if that matters)
>>>> > issues
>>>> > warnings:
>>>> >
>>>> > cannot scan executable section 1 of libx264.a(dct-a.o) for Cortex-A8
>>>> > erratum
>>>> > because it has no mapping symbols
>>>> >
>>>> > ... same warning for all assembly files in libx264.
>>>> >
>>>> > libx264.a itself was cross-compiled on the same Mac with the same 4.6
>>>> > toolchain taken from NDK. Is it a problem with the new linker, or with
>>>> > the
>>>> > assembler that produced dct-a.o from dct-a.S, or with our configuration?
>>>> >
>>>> > Sincerely,
>>>> > Alex
>>>> >
>>>> > --
>>>> > You received this message because you are subscribed to the Google
>>>> > Groups
>>>> > "android-ndk" group.
>>>> > To view this discussion on the web visit
>>>> > https://groups.google.com/d/msg/android-ndk/-/old7pyBxCKgJ.
>>>> > To post to this group, send email to [hidden email].
>>>> > To unsubscribe from this group, send email to
>>>> > [hidden email].
>>>> > For more options, visit this group at
>>>> > http://groups.google.com/group/android-ndk?hl=en.
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google Groups
>>>> "android-ndk" group.
>>>> To post to this group, send email to [hidden email].
>>>> To unsubscribe from this group, send email to
>>>> [hidden email].
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/android-ndk?hl=en.
>>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "android-ndk" group.
>>> To post to this group, send email to [hidden email].
>>> To unsubscribe from this group, send email to
>>> [hidden email].
>>> For more options, visit this group at
>>> http://groups.google.com/group/android-ndk?hl=en.
>>
>> --
>> You received this message because you are subscribed to the Google Groups "android-ndk" group.
>> To post to this group, send email to [hidden email].
>> To unsubscribe from this group, send email to [hidden email].
>> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.
> To post to this group, send email to [hidden email].
> To unsubscribe from this group, send email to [hidden email].
> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: NDK r8c linker warnings for asm files from libx264

Alex Cohn-2
I tried to add the mapping symbols manually to dct-a.S following the
ARM.com instructions
(http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0064d/BABCGAAH.html),
but this had no effect. On the other hand, correct me if I am wrong,
but at least these assembly files for x264 compile in ARM+NEON, not
THUMB-2 instruction set.

Does that mean that we are safe?

BR,
Alex

On Fri, Dec 7, 2012 at 1:59 AM, Doug Kwan (關振德) <[hidden email]> wrote:

> Thanks for the instructions.
>
> The warning means that gold cannot tell what kind of bits
> (data/arm/thumb) a section contains and thus it would skip fixing up
> the section for the cortex-A8 erratum workaround.  In the very
> unlikely event that your code runs on an early cortex-A8 core with
> that hardware bug, bad things can happen.  Applying the fix requires
> changing instructions so the linker has to be absolutely sure that it
> is dealing with THUMB-2 instructions at locations where it is looking
> for this bug.
>
> -Doug
>
> On Thu, Dec 6, 2012 at 3:46 PM, Alex Cohn <[hidden email]> wrote:
>> On Mon, Dec 3, 2012 at 8:36 PM, Doug Kwan (關振德) <[hidden email]> wrote:
>>> Do have detail instructions for reproducing this problem?
>>
>> 1. Download x264-snapshot-20121203-2245 from
>> ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
>>
>> 2. Run ./configure --enable-pic --enable-strip --enable-static
>> --cross-prefix=~/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-
>> --sysroot=~/android-ndk-r8c/platforms/android-14/arch-arm
>> --host=arm-linux
>>
>> 3. Run ~/android-ndk-r8c/prebuilt/linux-x86/bin/make
>>
>> It will build the static library, and after that display the Cortex-A8
>> warning while linking the x265 executable. I am not worried about the
>> compiler warnings, because building libx264.a is done offline, it is
>> not part of our official daily build.
>>
>> Actually, I would first of all want to know: what is the meaning of
>> this warning? If there are no real-life consequences, I can live with
>> it for a while... But I am concerned with what will happen if our
>> program gets loaded on one of the faulty chips.
>>
>> BTW, I have reproduced the result on Ubuntu, so it is not Mac-specific.
>>
>> Thanks,
>> Alex
>>
>>> On Mon, Dec 3, 2012 at 1:33 AM, Alex Cohn <[hidden email]> wrote:
>>>> On Mon, Dec 3, 2012 at 8:36 AM, Doug Kwan (關振德) <[hidden email]> wrote:
>>>>>
>>>>> For the Cortex-A8 hardware erratum, the linker needs to rewrite
>>>>> certain instructions that may trigger the hardware bug.  To that
>>>>> reliably, the linker needs to know whether a location contains an ARM
>>>>> instruction,a THUMB instruction or a piece of data.  The mapping
>>>>> symbol is inserted to by the assembly for that purpose.  Without these
>>>>> mapping symbol, the linker cannot apply the workaround.
>>>>
>>>>
>>>> Thanks, I know the theory. My problem is that I could not find how to modify
>>>> the x264 ARM assembly files to would satisfy the r8c linker. Note that we
>>>> did not see this warning with r8b linker.
>>>>
>>>> Alex
>>>>
>>>>> On Sun, Dec 2, 2012 at 7:51 AM, Alex Cohn <[hidden email]> wrote:
>>>>> > With NDK r8c, linking of X264 encoder (on Mac OS, if that matters)
>>>>> > issues
>>>>> > warnings:
>>>>> >
>>>>> > cannot scan executable section 1 of libx264.a(dct-a.o) for Cortex-A8
>>>>> > erratum
>>>>> > because it has no mapping symbols
>>>>> >
>>>>> > ... same warning for all assembly files in libx264.
>>>>> >
>>>>> > libx264.a itself was cross-compiled on the same Mac with the same 4.6
>>>>> > toolchain taken from NDK. Is it a problem with the new linker, or with
>>>>> > the
>>>>> > assembler that produced dct-a.o from dct-a.S, or with our configuration?
>>>>> >
>>>>> > Sincerely,
>>>>> > Alex
>>>>> >
>>>>> > --
>>>>> > You received this message because you are subscribed to the Google
>>>>> > Groups
>>>>> > "android-ndk" group.
>>>>> > To view this discussion on the web visit
>>>>> > https://groups.google.com/d/msg/android-ndk/-/old7pyBxCKgJ.
>>>>> > To post to this group, send email to [hidden email].
>>>>> > To unsubscribe from this group, send email to
>>>>> > [hidden email].
>>>>> > For more options, visit this group at
>>>>> > http://groups.google.com/group/android-ndk?hl=en.
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google Groups
>>>>> "android-ndk" group.
>>>>> To post to this group, send email to [hidden email].
>>>>> To unsubscribe from this group, send email to
>>>>> [hidden email].
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/group/android-ndk?hl=en.
>>>>>
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google Groups
>>>> "android-ndk" group.
>>>> To post to this group, send email to [hidden email].
>>>> To unsubscribe from this group, send email to
>>>> [hidden email].
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/android-ndk?hl=en.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups "android-ndk" group.
>>> To post to this group, send email to [hidden email].
>>> To unsubscribe from this group, send email to [hidden email].
>>> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups "android-ndk" group.
>> To post to this group, send email to [hidden email].
>> To unsubscribe from this group, send email to [hidden email].
>> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.
> To post to this group, send email to [hidden email].
> To unsubscribe from this group, send email to [hidden email].
> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: NDK r8c linker warnings for asm files from libx264

Doug Kwan (關振德)
If you can be sure that there are is not any 32-bit thumb2 instruction
crossing a page boundary, then it is fine.  Since your code is in ARM
mode, it should be safe.

-Doug

On Thu, Dec 6, 2012 at 4:17 PM, Alex Cohn <[hidden email]> wrote:

> I tried to add the mapping symbols manually to dct-a.S following the
> ARM.com instructions
> (http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0064d/BABCGAAH.html),
> but this had no effect. On the other hand, correct me if I am wrong,
> but at least these assembly files for x264 compile in ARM+NEON, not
> THUMB-2 instruction set.
>
> Does that mean that we are safe?
>
> BR,
> Alex
>
> On Fri, Dec 7, 2012 at 1:59 AM, Doug Kwan (關振德) <[hidden email]> wrote:
>> Thanks for the instructions.
>>
>> The warning means that gold cannot tell what kind of bits
>> (data/arm/thumb) a section contains and thus it would skip fixing up
>> the section for the cortex-A8 erratum workaround.  In the very
>> unlikely event that your code runs on an early cortex-A8 core with
>> that hardware bug, bad things can happen.  Applying the fix requires
>> changing instructions so the linker has to be absolutely sure that it
>> is dealing with THUMB-2 instructions at locations where it is looking
>> for this bug.
>>
>> -Doug
>>
>> On Thu, Dec 6, 2012 at 3:46 PM, Alex Cohn <[hidden email]> wrote:
>>> On Mon, Dec 3, 2012 at 8:36 PM, Doug Kwan (關振德) <[hidden email]> wrote:
>>>> Do have detail instructions for reproducing this problem?
>>>
>>> 1. Download x264-snapshot-20121203-2245 from
>>> ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
>>>
>>> 2. Run ./configure --enable-pic --enable-strip --enable-static
>>> --cross-prefix=~/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-
>>> --sysroot=~/android-ndk-r8c/platforms/android-14/arch-arm
>>> --host=arm-linux
>>>
>>> 3. Run ~/android-ndk-r8c/prebuilt/linux-x86/bin/make
>>>
>>> It will build the static library, and after that display the Cortex-A8
>>> warning while linking the x265 executable. I am not worried about the
>>> compiler warnings, because building libx264.a is done offline, it is
>>> not part of our official daily build.
>>>
>>> Actually, I would first of all want to know: what is the meaning of
>>> this warning? If there are no real-life consequences, I can live with
>>> it for a while... But I am concerned with what will happen if our
>>> program gets loaded on one of the faulty chips.
>>>
>>> BTW, I have reproduced the result on Ubuntu, so it is not Mac-specific.
>>>
>>> Thanks,
>>> Alex
>>>
>>>> On Mon, Dec 3, 2012 at 1:33 AM, Alex Cohn <[hidden email]> wrote:
>>>>> On Mon, Dec 3, 2012 at 8:36 AM, Doug Kwan (關振德) <[hidden email]> wrote:
>>>>>>
>>>>>> For the Cortex-A8 hardware erratum, the linker needs to rewrite
>>>>>> certain instructions that may trigger the hardware bug.  To that
>>>>>> reliably, the linker needs to know whether a location contains an ARM
>>>>>> instruction,a THUMB instruction or a piece of data.  The mapping
>>>>>> symbol is inserted to by the assembly for that purpose.  Without these
>>>>>> mapping symbol, the linker cannot apply the workaround.
>>>>>
>>>>>
>>>>> Thanks, I know the theory. My problem is that I could not find how to modify
>>>>> the x264 ARM assembly files to would satisfy the r8c linker. Note that we
>>>>> did not see this warning with r8b linker.
>>>>>
>>>>> Alex
>>>>>
>>>>>> On Sun, Dec 2, 2012 at 7:51 AM, Alex Cohn <[hidden email]> wrote:
>>>>>> > With NDK r8c, linking of X264 encoder (on Mac OS, if that matters)
>>>>>> > issues
>>>>>> > warnings:
>>>>>> >
>>>>>> > cannot scan executable section 1 of libx264.a(dct-a.o) for Cortex-A8
>>>>>> > erratum
>>>>>> > because it has no mapping symbols
>>>>>> >
>>>>>> > ... same warning for all assembly files in libx264.
>>>>>> >
>>>>>> > libx264.a itself was cross-compiled on the same Mac with the same 4.6
>>>>>> > toolchain taken from NDK. Is it a problem with the new linker, or with
>>>>>> > the
>>>>>> > assembler that produced dct-a.o from dct-a.S, or with our configuration?
>>>>>> >
>>>>>> > Sincerely,
>>>>>> > Alex
>>>>>> >
>>>>>> > --
>>>>>> > You received this message because you are subscribed to the Google
>>>>>> > Groups
>>>>>> > "android-ndk" group.
>>>>>> > To view this discussion on the web visit
>>>>>> > https://groups.google.com/d/msg/android-ndk/-/old7pyBxCKgJ.
>>>>>> > To post to this group, send email to [hidden email].
>>>>>> > To unsubscribe from this group, send email to
>>>>>> > [hidden email].
>>>>>> > For more options, visit this group at
>>>>>> > http://groups.google.com/group/android-ndk?hl=en.
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google Groups
>>>>>> "android-ndk" group.
>>>>>> To post to this group, send email to [hidden email].
>>>>>> To unsubscribe from this group, send email to
>>>>>> [hidden email].
>>>>>> For more options, visit this group at
>>>>>> http://groups.google.com/group/android-ndk?hl=en.
>>>>>>
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google Groups
>>>>> "android-ndk" group.
>>>>> To post to this group, send email to [hidden email].
>>>>> To unsubscribe from this group, send email to
>>>>> [hidden email].
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/group/android-ndk?hl=en.
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google Groups "android-ndk" group.
>>>> To post to this group, send email to [hidden email].
>>>> To unsubscribe from this group, send email to [hidden email].
>>>> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups "android-ndk" group.
>>> To post to this group, send email to [hidden email].
>>> To unsubscribe from this group, send email to [hidden email].
>>> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups "android-ndk" group.
>> To post to this group, send email to [hidden email].
>> To unsubscribe from this group, send email to [hidden email].
>> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.
> To post to this group, send email to [hidden email].
> To unsubscribe from this group, send email to [hidden email].
> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: NDK r8c linker warnings for asm files from libx264

Alex Cohn-2
On Fri, Dec 7, 2012 at 2:22 AM, Doug Kwan (關振德) <[hidden email]> wrote:
> If you can be sure that there are is not any 32-bit thumb2 instruction
> crossing a page boundary, then it is fine.  Since your code is in ARM
> mode, it should be safe.
>
> -Doug

Thanks a lot, that's a relief

Alex

> On Thu, Dec 6, 2012 at 4:17 PM, Alex Cohn <[hidden email]> wrote:
>> I tried to add the mapping symbols manually to dct-a.S following the
>> ARM.com instructions
>> (http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0064d/BABCGAAH.html),
>> but this had no effect. On the other hand, correct me if I am wrong,
>> but at least these assembly files for x264 compile in ARM+NEON, not
>> THUMB-2 instruction set.
>>
>> Does that mean that we are safe?
>>
>> BR,
>> Alex
>>
>> On Fri, Dec 7, 2012 at 1:59 AM, Doug Kwan (關振德) <[hidden email]> wrote:
>>> Thanks for the instructions.
>>>
>>> The warning means that gold cannot tell what kind of bits
>>> (data/arm/thumb) a section contains and thus it would skip fixing up
>>> the section for the cortex-A8 erratum workaround.  In the very
>>> unlikely event that your code runs on an early cortex-A8 core with
>>> that hardware bug, bad things can happen.  Applying the fix requires
>>> changing instructions so the linker has to be absolutely sure that it
>>> is dealing with THUMB-2 instructions at locations where it is looking
>>> for this bug.
>>>
>>> -Doug
>>>
>>> On Thu, Dec 6, 2012 at 3:46 PM, Alex Cohn <[hidden email]> wrote:
>>>> On Mon, Dec 3, 2012 at 8:36 PM, Doug Kwan (關振德) <[hidden email]> wrote:
>>>>> Do have detail instructions for reproducing this problem?
>>>>
>>>> 1. Download x264-snapshot-20121203-2245 from
>>>> ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
>>>>
>>>> 2. Run ./configure --enable-pic --enable-strip --enable-static
>>>> --cross-prefix=~/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-
>>>> --sysroot=~/android-ndk-r8c/platforms/android-14/arch-arm
>>>> --host=arm-linux
>>>>
>>>> 3. Run ~/android-ndk-r8c/prebuilt/linux-x86/bin/make
>>>>
>>>> It will build the static library, and after that display the Cortex-A8
>>>> warning while linking the x265 executable. I am not worried about the
>>>> compiler warnings, because building libx264.a is done offline, it is
>>>> not part of our official daily build.
>>>>
>>>> Actually, I would first of all want to know: what is the meaning of
>>>> this warning? If there are no real-life consequences, I can live with
>>>> it for a while... But I am concerned with what will happen if our
>>>> program gets loaded on one of the faulty chips.
>>>>
>>>> BTW, I have reproduced the result on Ubuntu, so it is not Mac-specific.
>>>>
>>>> Thanks,
>>>> Alex
>>>>
>>>>> On Mon, Dec 3, 2012 at 1:33 AM, Alex Cohn <[hidden email]> wrote:
>>>>>> On Mon, Dec 3, 2012 at 8:36 AM, Doug Kwan (關振德) <[hidden email]> wrote:
>>>>>>>
>>>>>>> For the Cortex-A8 hardware erratum, the linker needs to rewrite
>>>>>>> certain instructions that may trigger the hardware bug.  To that
>>>>>>> reliably, the linker needs to know whether a location contains an ARM
>>>>>>> instruction,a THUMB instruction or a piece of data.  The mapping
>>>>>>> symbol is inserted to by the assembly for that purpose.  Without these
>>>>>>> mapping symbol, the linker cannot apply the workaround.
>>>>>>
>>>>>>
>>>>>> Thanks, I know the theory. My problem is that I could not find how to modify
>>>>>> the x264 ARM assembly files to would satisfy the r8c linker. Note that we
>>>>>> did not see this warning with r8b linker.
>>>>>>
>>>>>> Alex
>>>>>>
>>>>>>> On Sun, Dec 2, 2012 at 7:51 AM, Alex Cohn <[hidden email]> wrote:
>>>>>>> > With NDK r8c, linking of X264 encoder (on Mac OS, if that matters)
>>>>>>> > issues
>>>>>>> > warnings:
>>>>>>> >
>>>>>>> > cannot scan executable section 1 of libx264.a(dct-a.o) for Cortex-A8
>>>>>>> > erratum
>>>>>>> > because it has no mapping symbols
>>>>>>> >
>>>>>>> > ... same warning for all assembly files in libx264.
>>>>>>> >
>>>>>>> > libx264.a itself was cross-compiled on the same Mac with the same 4.6
>>>>>>> > toolchain taken from NDK. Is it a problem with the new linker, or with
>>>>>>> > the
>>>>>>> > assembler that produced dct-a.o from dct-a.S, or with our configuration?
>>>>>>> >
>>>>>>> > Sincerely,
>>>>>>> > Alex
>>>>>>> >
>>>>>>> > --
>>>>>>> > You received this message because you are subscribed to the Google
>>>>>>> > Groups
>>>>>>> > "android-ndk" group.
>>>>>>> > To view this discussion on the web visit
>>>>>>> > https://groups.google.com/d/msg/android-ndk/-/old7pyBxCKgJ.
>>>>>>> > To post to this group, send email to [hidden email].
>>>>>>> > To unsubscribe from this group, send email to
>>>>>>> > [hidden email].
>>>>>>> > For more options, visit this group at
>>>>>>> > http://groups.google.com/group/android-ndk?hl=en.
>>>>>>>
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google Groups
>>>>>>> "android-ndk" group.
>>>>>>> To post to this group, send email to [hidden email].
>>>>>>> To unsubscribe from this group, send email to
>>>>>>> [hidden email].
>>>>>>> For more options, visit this group at
>>>>>>> http://groups.google.com/group/android-ndk?hl=en.
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google Groups
>>>>>> "android-ndk" group.
>>>>>> To post to this group, send email to [hidden email].
>>>>>> To unsubscribe from this group, send email to
>>>>>> [hidden email].
>>>>>> For more options, visit this group at
>>>>>> http://groups.google.com/group/android-ndk?hl=en.
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google Groups "android-ndk" group.
>>>>> To post to this group, send email to [hidden email].
>>>>> To unsubscribe from this group, send email to [hidden email].
>>>>> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>>>>>
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google Groups "android-ndk" group.
>>>> To post to this group, send email to [hidden email].
>>>> To unsubscribe from this group, send email to [hidden email].
>>>> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups "android-ndk" group.
>>> To post to this group, send email to [hidden email].
>>> To unsubscribe from this group, send email to [hidden email].
>>> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups "android-ndk" group.
>> To post to this group, send email to [hidden email].
>> To unsubscribe from this group, send email to [hidden email].
>> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.
> To post to this group, send email to [hidden email].
> To unsubscribe from this group, send email to [hidden email].
> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: NDK r8c linker warnings for asm files from libx264

Alex Cohn-2
In reply to this post by Doug Kwan (關振德)
Got THE answer: from Andrew:
http://code.google.com/p/android/issues/detail?id=40794#c4

ts;nr: h264 makefile forcefully strips the mapping symbols. I have
double checked: it is not my `--enable-strip` for `./configure` that
makes this happen

Thanks,
Alex.

On Fri, Dec 7, 2012 at 2:22 AM, Doug Kwan (關振德) <[hidden email]> wrote:

> If you can be sure that there are is not any 32-bit thumb2 instruction
> crossing a page boundary, then it is fine.  Since your code is in ARM
> mode, it should be safe.
>
> -Doug
>
> On Thu, Dec 6, 2012 at 4:17 PM, Alex Cohn <[hidden email]> wrote:
>> I tried to add the mapping symbols manually to dct-a.S following the
>> ARM.com instructions
>> (http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0064d/BABCGAAH.html),
>> but this had no effect. On the other hand, correct me if I am wrong,
>> but at least these assembly files for x264 compile in ARM+NEON, not
>> THUMB-2 instruction set.
>>
>> Does that mean that we are safe?
>>
>> BR,
>> Alex
>>
>> On Fri, Dec 7, 2012 at 1:59 AM, Doug Kwan (關振德) <[hidden email]> wrote:
>>> Thanks for the instructions.
>>>
>>> The warning means that gold cannot tell what kind of bits
>>> (data/arm/thumb) a section contains and thus it would skip fixing up
>>> the section for the cortex-A8 erratum workaround.  In the very
>>> unlikely event that your code runs on an early cortex-A8 core with
>>> that hardware bug, bad things can happen.  Applying the fix requires
>>> changing instructions so the linker has to be absolutely sure that it
>>> is dealing with THUMB-2 instructions at locations where it is looking
>>> for this bug.
>>>
>>> -Doug
>>>
>>> On Thu, Dec 6, 2012 at 3:46 PM, Alex Cohn <[hidden email]> wrote:
>>>> On Mon, Dec 3, 2012 at 8:36 PM, Doug Kwan (關振德) <[hidden email]> wrote:
>>>>> Do have detail instructions for reproducing this problem?
>>>>
>>>> 1. Download x264-snapshot-20121203-2245 from
>>>> ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
>>>>
>>>> 2. Run ./configure --enable-pic --enable-strip --enable-static
>>>> --cross-prefix=~/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-
>>>> --sysroot=~/android-ndk-r8c/platforms/android-14/arch-arm
>>>> --host=arm-linux
>>>>
>>>> 3. Run ~/android-ndk-r8c/prebuilt/linux-x86/bin/make
>>>>
>>>> It will build the static library, and after that display the Cortex-A8
>>>> warning while linking the x265 executable. I am not worried about the
>>>> compiler warnings, because building libx264.a is done offline, it is
>>>> not part of our official daily build.
>>>>
>>>> Actually, I would first of all want to know: what is the meaning of
>>>> this warning? If there are no real-life consequences, I can live with
>>>> it for a while... But I am concerned with what will happen if our
>>>> program gets loaded on one of the faulty chips.
>>>>
>>>> BTW, I have reproduced the result on Ubuntu, so it is not Mac-specific.
>>>>
>>>> Thanks,
>>>> Alex
>>>>
>>>>> On Mon, Dec 3, 2012 at 1:33 AM, Alex Cohn <[hidden email]> wrote:
>>>>>> On Mon, Dec 3, 2012 at 8:36 AM, Doug Kwan (關振德) <[hidden email]> wrote:
>>>>>>>
>>>>>>> For the Cortex-A8 hardware erratum, the linker needs to rewrite
>>>>>>> certain instructions that may trigger the hardware bug.  To that
>>>>>>> reliably, the linker needs to know whether a location contains an ARM
>>>>>>> instruction,a THUMB instruction or a piece of data.  The mapping
>>>>>>> symbol is inserted to by the assembly for that purpose.  Without these
>>>>>>> mapping symbol, the linker cannot apply the workaround.
>>>>>>
>>>>>>
>>>>>> Thanks, I know the theory. My problem is that I could not find how to modify
>>>>>> the x264 ARM assembly files to would satisfy the r8c linker. Note that we
>>>>>> did not see this warning with r8b linker.
>>>>>>
>>>>>> Alex
>>>>>>
>>>>>>> On Sun, Dec 2, 2012 at 7:51 AM, Alex Cohn <[hidden email]> wrote:
>>>>>>> > With NDK r8c, linking of X264 encoder (on Mac OS, if that matters)
>>>>>>> > issues
>>>>>>> > warnings:
>>>>>>> >
>>>>>>> > cannot scan executable section 1 of libx264.a(dct-a.o) for Cortex-A8
>>>>>>> > erratum
>>>>>>> > because it has no mapping symbols
>>>>>>> >
>>>>>>> > ... same warning for all assembly files in libx264.
>>>>>>> >
>>>>>>> > libx264.a itself was cross-compiled on the same Mac with the same 4.6
>>>>>>> > toolchain taken from NDK. Is it a problem with the new linker, or with
>>>>>>> > the
>>>>>>> > assembler that produced dct-a.o from dct-a.S, or with our configuration?
>>>>>>> >
>>>>>>> > Sincerely,
>>>>>>> > Alex
>>>>>>> >
>>>>>>> > --
>>>>>>> > You received this message because you are subscribed to the Google
>>>>>>> > Groups
>>>>>>> > "android-ndk" group.
>>>>>>> > To view this discussion on the web visit
>>>>>>> > https://groups.google.com/d/msg/android-ndk/-/old7pyBxCKgJ.
>>>>>>> > To post to this group, send email to [hidden email].
>>>>>>> > To unsubscribe from this group, send email to
>>>>>>> > [hidden email].
>>>>>>> > For more options, visit this group at
>>>>>>> > http://groups.google.com/group/android-ndk?hl=en.
>>>>>>>
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google Groups
>>>>>>> "android-ndk" group.
>>>>>>> To post to this group, send email to [hidden email].
>>>>>>> To unsubscribe from this group, send email to
>>>>>>> [hidden email].
>>>>>>> For more options, visit this group at
>>>>>>> http://groups.google.com/group/android-ndk?hl=en.
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google Groups
>>>>>> "android-ndk" group.
>>>>>> To post to this group, send email to [hidden email].
>>>>>> To unsubscribe from this group, send email to
>>>>>> [hidden email].
>>>>>> For more options, visit this group at
>>>>>> http://groups.google.com/group/android-ndk?hl=en.
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google Groups "android-ndk" group.
>>>>> To post to this group, send email to [hidden email].
>>>>> To unsubscribe from this group, send email to [hidden email].
>>>>> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>>>>>
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google Groups "android-ndk" group.
>>>> To post to this group, send email to [hidden email].
>>>> To unsubscribe from this group, send email to [hidden email].
>>>> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups "android-ndk" group.
>>> To post to this group, send email to [hidden email].
>>> To unsubscribe from this group, send email to [hidden email].
>>> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups "android-ndk" group.
>> To post to this group, send email to [hidden email].
>> To unsubscribe from this group, send email to [hidden email].
>> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.
> To post to this group, send email to [hidden email].
> To unsubscribe from this group, send email to [hidden email].
> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.