From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id D7E2A4F9B1 for ; Mon, 23 Jun 2025 23:09:24 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 58ECD68D71E; Tue, 24 Jun 2025 02:09:20 +0300 (EEST) References: <20250321002820.717356-1-prka@google.com> In-Reply-To: Date: Mon, 23 Jun 2025 16:09:01 -0700 To: FFmpeg development discussions and patches MIME-Version: 1.0 Message-ID: List-Id: FFmpeg development discussions and patches List-Post: From: Pranav Kant via ffmpeg-devel Precedence: list Cc: Pranav Kant X-Mailman-Version: 2.1.29 X-BeenThere: ffmpeg-devel@ffmpeg.org List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: FFmpeg development discussions and patches List-Help: Subject: Re: [FFmpeg-devel] [PATCH v5] Mark C globals with small code model Content-Type: multipart/mixed; boundary="===============4288652665399945668==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============4288652665399945668== Content-Type: message/rfc822 Content-Disposition: inline Return-Path: X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 0CA1468D640 for ; Tue, 24 Jun 2025 02:09:14 +0300 (EEST) Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-6098ef283f0so4290a12.0 for ; Mon, 23 Jun 2025 16:09:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1750720153; x=1751324953; darn=ffmpeg.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=dyWirTIcfxNUjFgMA4L7zFYeMI7TJkVQIXejqFpmVUs=; b=flg4qjRzIxgeGCqXLiNVHRIUhDUDkpH/3ekEe/l1wUTxGnnocwQf6VmpEb1fB1IJxS HyKSaLO3Vw/PyHfir0VAAvY7JMRSVLS6eklgkzUjLVsgdIcLHHc2zemmK9SFWdy17/cO l76xWcicYnjN42UVMifMZ7NKDroYZYSry8soh7m3ZFvB5oIpNqLOHUIRS6PuuuGyiBFP KOpt8TigIr4L7KuF+Lkmv4gR0YBeNagr8gDntoirMINvcfriPlk/yIvkIm8sdUXNJ74v 7QLCG+vQbKeMlzBTM03uYPthekb0gfYU1bR9rxi6xZHczKw1hYMGon0Ysm2Nck1PboKa anig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750720153; x=1751324953; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dyWirTIcfxNUjFgMA4L7zFYeMI7TJkVQIXejqFpmVUs=; b=wVsDZpLPepk+OBChy2DpjjmyOgL6s/IsVsV4VqJF+m8g+tztIxH8y3mid1nu3xMd/n aJhJacR8a5SgP0Gk331UZzHVcExELypGwSPubYaAw/YUO/NpbfsSFFjZeXG/5R4ga2CR E2Ds51jFJGSarIuU9E4vftTPu/c4Z2YH3psVVssTa8cOh6GxNoEVh6ax9UCyxWrpCyHq Uo28f85r5FN118D0m31DiskGh0mSPPhX+yEttmjFkLu0LB5wJ8I8ccCSZ5Wf8siHemD2 pBmctzuoVuLPU8fkaqrVCXFmB17cfTb+DiycgmpXQiSh3X8b8yAGsLapy4hd4+4kgTjE tC2g== X-Gm-Message-State: AOJu0YzQ81KiEcWhHFjm6bvQURw3LZUkqJULaBFeeGcA2voqUyBGREzp ZBBPBPKtgWspinDzZDBzgRoORoWvA6cwIqW2f8gMpfcXLYdK8jUF9BI298SMTKjuYFncqpTtHDi mCnQ74nnVRJv2qRTOFrtTK2hTFc1CUcVz0nBXpEk9x+iwzCCdBNmJHdvy X-Gm-Gg: ASbGncvLOWZ51VVnc6HwAhStpQHyGvuGArYNB1K11vRl6rdsR93v8rhtqLwMbd2zyD9 Upp4DgTtprWSypz4V6zSmMwjSfKyowPD6WvPAsZz2JX1UhxGFzVILrckNPT1a1kG78WXKGmgCIQ cSD8M1Y3/l/0XrLnmFGmB8psMS/kVkTvacX+KSOpG5eveqLdPYq0i2feLC34iEuWoom2fxZHoWw w== X-Google-Smtp-Source: AGHT+IH8tgrGhAIwIAu5OeuheCGbhu6do+FuROxPB2ZrM70FbhjJkHvhZu118CQkx+lxIzlsX+MAzllJx0hTsIYVf6A= X-Received: by 2002:a05:6402:4415:b0:606:f77b:7943 with SMTP id 4fb4d7f45d1cf-60c271e935fmr44858a12.0.1750720152725; Mon, 23 Jun 2025 16:09:12 -0700 (PDT) MIME-Version: 1.0 References: <20250321002820.717356-1-prka@google.com> In-Reply-To: From: Pranav Kant Date: Mon, 23 Jun 2025 16:09:01 -0700 X-Gm-Features: AX0GCFvDvC8NOVXmHYW0Yf2-F6R02AqjLllFTwBqZlxruyXWjFiyQdXtiY6zezM Message-ID: Subject: Re: [FFmpeg-devel] [PATCH v5] Mark C globals with small code model To: FFmpeg development discussions and patches Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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=E2=80=AFAM R=C3=A9mi Denis-Courmont wrote: > Hi, > > This looks like a kludge to me. If static variables are too far away, the= n > 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". > --===============4288652665399945668== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============4288652665399945668==--