From: Pranav Kant via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Pranav Kant <prka@google.com>
Subject: Re: [FFmpeg-devel] [PATCH v5] Mark C globals with small code model
Date: Mon, 23 Jun 2025 16:09:01 -0700
Message-ID: <mailman.4168.1750720159.1384.ffmpeg-devel@ffmpeg.org> (raw)
In-Reply-To: <E3E1D652-0D9A-4729-BC22-8CB13FADF637@remlab.net>
[-- Attachment #1: Type: message/rfc822, Size: 5468 bytes --]
From: Pranav Kant <prka@google.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v5] Mark C globals with small code model
Date: Mon, 23 Jun 2025 16:09:01 -0700
Message-ID: <CAPvNhsJEfYANR91PT7GaR3yrA-o28nmQ-mv45Opywaot=AE=Xw@mail.gmail.com>
Apologies for the late reply.
Yeah, the other solution to solve this problem is to sprinkle .gotpcrel all
over the x86 assembly whenever it tries to access a variable that's defined
in the C file.
Using `attribute(small)`, as in this patch, is behind a macro that implies
that variable is referenced from the assembly file which only gets
activated for x86 and ELF. We are not putting x86-specific hacks all over
the code. We are putting indicators/macros all over the code against
variables that are defined in C files but accessed in assembly files. This
will also help us to extend the definitions of these macros in future as
alluded to by Andreas and Martin in above discussion. It's good to wrap
these variables that are referenced from external assembly for this reason.
Please make sure you are seeing version 6 of this patch. What you are
describing was done in the first version of this patch.
On Wed, May 7, 2025 at 5:15 AM Rémi Denis-Courmont <remi@remlab.net> wrote:
> Hi,
>
> This looks like a kludge to me. If static variables are too far away, then
> the assembler code that refers to them needs to be fixed, and that's all
> that there is to it.
>
> You can't just magically make the data and the code closer, especially if
> FFmpeg is compiled as a static library (a very common use case).
>
> Also putting x86-specific hacks all over the code base, meh. Other
> architectures have all dealt with that issue cleanly already.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2025-06-23 23:09 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-25 21:37 [FFmpeg-devel] [PATCH] " Pranav Kant via ffmpeg-devel
2025-02-25 23:03 ` Andreas Rheinhardt
2025-02-26 19:44 ` Pranav Kant via ffmpeg-devel
2025-02-26 19:45 ` Pranav Kant via ffmpeg-devel
2025-02-27 3:36 ` James Zern via ffmpeg-devel
2025-02-28 1:14 ` Michael Niedermayer
2025-03-07 2:13 ` Pranav Kant via ffmpeg-devel
2025-03-03 20:56 ` [FFmpeg-devel] [PATCH v3] " Pranav Kant via ffmpeg-devel
2025-03-11 19:17 ` [FFmpeg-devel] [PATCH v4] " Pranav Kant via ffmpeg-devel
2025-03-11 19:18 ` Pranav Kant via ffmpeg-devel
2025-03-11 23:45 ` Andreas Rheinhardt
2025-03-12 7:05 ` Martin Storsjö
2025-03-12 7:17 ` Andreas Rheinhardt
2025-03-12 7:47 ` Martin Storsjö
2025-03-14 0:16 ` Pranav Kant via ffmpeg-devel
2025-03-21 0:28 ` [FFmpeg-devel] [PATCH v5] " Pranav Kant via ffmpeg-devel
2025-03-21 0:30 ` Pranav Kant via ffmpeg-devel
2025-04-04 18:40 ` Pranav Kant via ffmpeg-devel
2025-04-15 23:22 ` Pranav Kant via ffmpeg-devel
2025-04-29 1:19 ` Pranav Kant via ffmpeg-devel
2025-05-06 23:24 ` [FFmpeg-devel] [PATCH v6] " Pranav Kant via ffmpeg-devel
2025-05-06 23:27 ` Pranav Kant via ffmpeg-devel
2025-05-07 12:15 ` [FFmpeg-devel] [PATCH v5] " Rémi Denis-Courmont
2025-06-23 23:09 ` Pranav Kant via ffmpeg-devel [this message]
2025-02-28 2:31 ` [FFmpeg-devel] [PATCH] " Lynne
2025-03-07 2:14 ` Pranav Kant via ffmpeg-devel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=mailman.4168.1750720159.1384.ffmpeg-devel@ffmpeg.org \
--to=ffmpeg-devel@ffmpeg.org \
--cc=prka@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git