[FFmpeg-devel] [PATCH] libavcodec: Remove dynamic relocs from aarch64/h264idct_neon.S

Manoj Gupta manojgupta at chromium.org
Wed Jan 2 20:12:33 EET 2019


On Mon, Dec 31, 2018 at 8:31 AM Michael Niedermayer
<michael at niedermayer.cc> wrote:
>
> On Fri, Dec 28, 2018 at 03:12:53PM -0800, Manoj Gupta wrote:
> > Hi All,
> >
> > I recently had a problem building ffmpeg for AArch64 where lld linker
> > complained about text relocations in readonly segment. The following
> > patch fixes the linker complains by referring to a local label instead
> > of function name.
> >
> > This is similar in nature as the following previous commits:
> > https://www.mail-archive.com/ffmpeg-cvslog@ffmpeg.org/msg34290.html
> > https://www.mail-archive.com/ffmpeg-cvslog@ffmpeg.org/msg34419.html
> >
> > Thanks,
> > Manoj
> >
> > Patch:
> >
> > libavcodec: Remove dynamic relocs from aarch64/h264idct_neon.S
> >
> > Some of the assembly functions e.g. ff_h264_idct_dc_add_neon
> > has code like:
> >         movrel          x14, X(ff_h264_idct_add_neon)
> >
> > Linker cannot resolve them fully at link time and emits dynamic
> > relocations.
> > Use explicit labels instead so that no dynamic relocations are
> > needed at all.
> >
> > This avoids lld complains about text relocations.
> >
> > For background, see https://crbug.com/917919
> >
> > Signed-off-by: Manoj Gupta <manojgupta at chromium.org>
> > ---
> >  libavcodec/aarch64/h264idct_neon.S | 20 ++++++++++++--------
> >  1 file changed, 12 insertions(+), 8 deletions(-)
>
> Has this been tested on all common aarch64 platforms ?
>
I have tested this on Chromium with clang+lld linker and Debian
aarch64 cross compiler gcc + bfd linker.
Please let me know if more testing is needed.

> Also git doesnt separate the mail from the commit message and would
> put the wholw email as the commit message, i assume that is not
> intended.

Sorry for the confusion about the commit message. Only the text
following "Patch:" is intended to be the commit message, but I had
tried to add  more context before the
patch text. I am fine with sending a v2 patch just containing the commit msg.

Thanks,
Manoj

>
> thx
>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Modern terrorism, a quick summary: Need oil, start war with country that
> has oil, kill hundread thousand in war. Let country fall into chaos,
> be surprised about raise of fundamantalists. Drop more bombs, kill more
> people, be surprised about them taking revenge and drop even more bombs
> and strip your own citizens of their rights and freedoms. to be continued
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list