Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Martin Storsjö" <martin@martin.st>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v4] Mark C globals with small code model
Date: Wed, 12 Mar 2025 09:47:43 +0200 (EET)
Message-ID: <6dafa9d-e2aa-f08e-607d-1d5d98f495c@martin.st> (raw)
In-Reply-To: <GV1P250MB0737442CC58CD55627A1CAF08FD02@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM>

On Wed, 12 Mar 2025, Andreas Rheinhardt wrote:

> Martin Storsjö:
>> On Wed, 12 Mar 2025, Andreas Rheinhardt wrote:
>> 
>>> Pranav Kant via ffmpeg-devel:
>>>> + * all globals in a data section that's unreachable with PC relative
>>>> instructions
>>>> + * (small code model instruction sequence). We mark all such globals
>>>> with this
>>>> + * attribute_mcmodel_small to ensure assembly accessible globals
>>>> continue to be
>>>> + * allocated in sections reachable from PC relative instructions.
>>>> + */
>>>> +#if ARCH_X86_64 && defined(__ELF__) && AV_HAS_ATTRIBUTE(model)
>>>
>>> You make this ARCH_X86_64 only, yet the concept of code models also
>>> exists for other arches, e.g. AArch64. I presume that assembly for other
>>> arches presumes that we are not using the large code model for accesses,
>>> so that the same issue can happen with them. Then we have two options:
>> 
>> FWIW, in e4ac156b7c47725327dff78bb83f5eecbaee3add we added
>> attribute_visibility_hidden to a bunch of symbols that are accessed from
>> aarch64 assembly, in a similar fashion. While the effects are different,
>> I wonder if we should abstract these two down to a more generic
>> attribute for any symbol accessed directly from any assembly.
>> 
>
> As I said above: We would only need two macros: One for any object
> accessed from inline assembly and one for objects accessed by external
> assembly (and not inline assembly). The latter would be hidden
> visibility+small code model, the former would also have av_used. Of
> course, both would allow to specify alignment.
>
> But naming is hard. How about DECLARE_ASM_VAR and DECLARE_INLINE_ASM_VAR?

That sounds ok to me.

// Martin
_______________________________________________
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".

  reply	other threads:[~2025-03-12  7:47 UTC|newest]

Thread overview: 16+ 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ö [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=6dafa9d-e2aa-f08e-607d-1d5d98f495c@martin.st \
    --to=martin@martin.st \
    --cc=ffmpeg-devel@ffmpeg.org \
    /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