Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2227926/?format=api
{ "id": 2227926, "url": "http://patchwork.ozlabs.org/api/patches/2227926/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/patch/20260424134932.1638126-1-adhemerval.zanella@linaro.org/", "project": { "id": 41, "url": "http://patchwork.ozlabs.org/api/projects/41/?format=api", "name": "GNU C Library", "link_name": "glibc", "list_id": "libc-alpha.sourceware.org", "list_email": "libc-alpha@sourceware.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260424134932.1638126-1-adhemerval.zanella@linaro.org>", "list_archive_url": null, "date": "2026-04-24T13:49:23", "name": "arm: Enable static-pie support (BZ 34098)", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "f4c3543a4682d54373a6b0a971b083721ae747e4", "submitter": { "id": 66065, "url": "http://patchwork.ozlabs.org/api/people/66065/?format=api", "name": "Adhemerval Zanella", "email": "adhemerval.zanella@linaro.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/glibc/patch/20260424134932.1638126-1-adhemerval.zanella@linaro.org/mbox/", "series": [ { "id": 501369, "url": "http://patchwork.ozlabs.org/api/series/501369/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/list/?series=501369", "date": "2026-04-24T13:49:23", "name": "arm: Enable static-pie support (BZ 34098)", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/501369/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2227926/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2227926/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "libc-alpha@sourceware.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "libc-alpha@sourceware.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=KBLW2qRb;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org;\n receiver=patchwork.ozlabs.org)", "sourceware.org;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=KBLW2qRb", "sourceware.org;\n dmarc=pass (p=none dis=none) header.from=linaro.org", "sourceware.org; spf=pass smtp.mailfrom=linaro.org", "server2.sourceware.org;\n arc=none smtp.remote-ip=2607:f8b0:4864:20::1236" ], "Received": [ "from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g2DqF6rbcz1yDD\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 24 Apr 2026 23:50:01 +1000 (AEST)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 249EF4BB589F\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 24 Apr 2026 13:50:00 +0000 (GMT)", "from mail-dl1-x1236.google.com (mail-dl1-x1236.google.com\n [IPv6:2607:f8b0:4864:20::1236])\n by sourceware.org (Postfix) with ESMTPS id ADA0E4BAD17E\n for <libc-alpha@sourceware.org>; Fri, 24 Apr 2026 13:49:38 +0000 (GMT)", "by mail-dl1-x1236.google.com with SMTP id\n a92af1059eb24-12c6df0b9bbso4322140c88.1\n for <libc-alpha@sourceware.org>; Fri, 24 Apr 2026 06:49:38 -0700 (PDT)", "from mandiga.. ([2804:1b3:a7c0:44cb:19d7:6180:61b9:ffb3])\n by smtp.gmail.com with ESMTPSA id\n a92af1059eb24-12c74a18a2bsm48194211c88.10.2026.04.24.06.49.35\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 24 Apr 2026 06:49:36 -0700 (PDT)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 249EF4BB589F", "OpenDKIM Filter v2.11.0 sourceware.org ADA0E4BAD17E" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org ADA0E4BAD17E", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org ADA0E4BAD17E", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777038579; cv=none;\n b=dwAe8VZ708f7qpDg2S5qfrcSg8WAp2StnANfMdPBlH2Dgmj8s9TsXPGXg6qGaG/rKJZyPPwCknvuvxyBI1rZckd6mzL+ObF2K5hulreM1+A2tHmLf9obEZ5inSSsmD82Ga9SWCFgdhgImEj31uJl1+JyjacWW715lTjzjbIapUw=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777038579; c=relaxed/simple;\n bh=uJVNFHPSOUPnzmodQBGGTF1OE3r8+Ne5NDZAtseUkWk=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=ZkpcWlOGO+CIM61ipMGXtaLn1UCGmDj8qjXwsPQf8GJLJsJi832uxRNuUm6qyRxfa2/f4QExyRJIERtG3HEYl/ePFxov4oGGVt7hkGV2GNXC9tJAZoMgBYnAVA3Oj7qvscqU4om2iT1sQL2Uh/3KYli/HM0yCpLj0BLNptbIa6M=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1777038577; x=1777643377; darn=sourceware.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=2tcMc6s7Dk4U5t10L5Ys2B8+F8JJtIeFBHPnDGulTC8=;\n b=KBLW2qRbIO4zjc32oqL9eyEQALZamA4o1McOGxFggAflmKBx8XSZx6mYxc0fVZHOZT\n O3XITz/n/LoMon/VlNn9DdaprdTfHIsFW5pGkyBeExzr7tF6X02GOAmJ06ZarIBYBRj3\n hI3EKeTTxul4zDgP8wQBrmKzr8vriRzCl7uOVTFuTuzq6Gth3dZ+8Oy2rP9cAFjvNdys\n IbLjjaYTL0rB9B3o51BOd2l5ir/bo0RiLlOoZJT2n890OvIdB9qXNyN3qGnkC8r5gcED\n MVl3TXbodJynctm6Gke+l+DbWvhaM1CTCVxpBU1xQW4JyenqhdNtgaErE0OgL7+zEn04\n vvHg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777038577; x=1777643377;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=2tcMc6s7Dk4U5t10L5Ys2B8+F8JJtIeFBHPnDGulTC8=;\n b=ayWRMAsr5taN1d7Kel6PjNWDi+aFDyRYF9c/iLfvLx1h+/LWmd4jAnnZNvdrC4PQGh\n aOVb7lwoWIvWV49wdKn3tNkjTfEqYo0luvzcMKOTGrpcIksxqsiz+W/hPLtV9GLTrkJ+\n hx2ChsbqMRpcLK1GUxqjkGB6CneqZK8vu3JOl9tde8IOTVuqWn5MUSEmUh6PWA38CqUH\n 6AIKZb0QWKxNaBI2/JmvuHIgBFvnKQMk6Da9RawWTCQsJ99D4DXl4b96duxtHhVfFtsz\n NY7cHCnl9GzutQ9BQc10gfvKy1W7DBBSKCS1jQRAO4cjLrwL/jxKw3DvSJUnOSPLvyiL\n dtYQ==", "X-Gm-Message-State": "AOJu0Ywn7BPLHupZqM4MB34pjSHTyPoHZw81XFHmVuIg/Z0z52Kt8GLF\n DjgPZOT+US3i2r9ocSwa7T4F8m14RNhKFWXgD2UsUh8gv1sO9YLmKNBomt/JE/4wQg73LWczeAn\n ZYKMH", "X-Gm-Gg": "AeBDieuT25G+TbLmKIY3pAEuOZpOXM3DYqvNOV+VZRwvHcuY0A2oSpSyyMxp6we36OD\n oRrNdyYxpCV6xnHrasd/yL32FjHdMCN0CSrrx9+wpH0w2R+Zkmm5fObhkFxU7ArcQDRBODqoBCK\n YrDtFntLrraPyp6MGlF5DG7O/hLdpziyObdsXGpIcldLX1ybHYDK+NgDXQfwZbxHYzP83/HKD2K\n TU9UkHh1MYFw3yVaXom6zG9fsOlbrpSfQicWm/zv5/mS+tAMTMKZiSTy+XL31JmVOlZqn5P8kEL\n 7UnTxXOr/ywRc+22kRHnvlsVTGRgqpvV8OX2GhevDnSC+SijIZqCqZiZ/fqonS+dKU04aDnG+FZ\n rYYVZgWgVG9mnAUfqubIINUo8+b6NF9d7c5YjLk5U5gcKUgOcg+DhYz8wIgyXXgTME5GECXW76l\n ag5OHPlNb3chFO0dJLoknd1Xwj9JNI8uJdPxvugXZdELO91g==", "X-Received": "by 2002:a05:701b:2703:b0:12d:ca32:5a2 with SMTP id\n a92af1059eb24-12dca320673mr231436c88.6.1777038576947;\n Fri, 24 Apr 2026 06:49:36 -0700 (PDT)", "From": "Adhemerval Zanella <adhemerval.zanella@linaro.org>", "To": "libc-alpha@sourceware.org", "Cc": "Jaeyoon Jung <jaeyoon.jung@lge.com>,\n\tSam James <sam@gentoo.org>", "Subject": "[PATCH] arm: Enable static-pie support (BZ 34098)", "Date": "Fri, 24 Apr 2026 10:49:23 -0300", "Message-ID": "<20260424134932.1638126-1-adhemerval.zanella@linaro.org>", "X-Mailer": "git-send-email 2.43.0", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "libc-alpha@sourceware.org", "X-Mailman-Version": "2.1.30", "Precedence": "list", "List-Id": "Libc-alpha mailing list <libc-alpha.sourceware.org>", "List-Unsubscribe": "<https://sourceware.org/mailman/options/libc-alpha>,\n <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe>", "List-Archive": "<https://sourceware.org/pipermail/libc-alpha/>", "List-Post": "<mailto:libc-alpha@sourceware.org>", "List-Help": "<mailto:libc-alpha-request@sourceware.org?subject=help>", "List-Subscribe": "<https://sourceware.org/mailman/listinfo/libc-alpha>,\n <mailto:libc-alpha-request@sourceware.org?subject=subscribe>", "Errors-To": "libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org" }, "content": "It requires proper gcc support [1], and without proper compiler support\nthe arm configure disable static-pie support.\n\nThe start.S requires some adjustment to avoid loading main from\nthe GOT.\n\nChecked on arm-linux-gnueabihf with and without the gcc patch applied.\n\n[1] https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598610.html\n---\n NEWS | 3 +++\n sysdeps/arm/configure | 52 ++++++++++++++++++++++++++++++++++++++++\n sysdeps/arm/configure.ac | 29 ++++++++++++++++++++++\n sysdeps/arm/start.S | 16 +++++++++++++\n 4 files changed, 100 insertions(+)", "diff": "diff --git a/NEWS b/NEWS\nindex eac9322161..6a45bb06ff 100644\n--- a/NEWS\n+++ b/NEWS\n@@ -18,6 +18,9 @@ Major new features:\n \n * New locale added: hrx_BR (Hunsrik language spoken in Brazil).\n \n+* Static PIE is ow support for arm-*-linux-gnueabi. It requires toolchain\n+ support to correctly set the expected linker options.\n+\n Deprecated and removed features, and other changes affecting compatibility:\n \n * Although malloc and related functions currently return pointers\ndiff --git a/sysdeps/arm/configure b/sysdeps/arm/configure\nindex 935e022c74..b964c3917a 100644\n--- a/sysdeps/arm/configure\n+++ b/sysdeps/arm/configure\n@@ -1,6 +1,58 @@\n # This file is generated from configure.ac by Autoconf. DO NOT EDIT!\n # Local configure fragment for sysdeps/arm.\n \n+{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking if compiler support static PIE\" >&5\n+printf %s \"checking if compiler support static PIE... \" >&6; }\n+if test ${libc_cv_static_pie_on_arm+y}\n+then :\n+ printf %s \"(cached) \" >&6\n+else case e in #(\n+ e)\n+cat > conftest.S <<\\EOF\n+.text\n+.global _start\n+.type _start,#function\n+_start:\n+\n+.data\n+.align 2\n+ptr:\n+ /* This shoul produce an R_ARM_RELATIVE. */\n+ .word _start\n+EOF\n+\n+ libc_cv_static_pie_on_arm=no\n+ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static-pie -nostdlib -fPIE -o conftest conftest.S'\n+ { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$ac_try\\\"\"; } >&5\n+ (eval $ac_try) 2>&5\n+ ac_status=$?\n+ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n+ test $ac_status = 0; }; } \\\n+ && { ac_try='LC_ALL=C $READELF -Wr conftest | grep -q R_ARM_RELATIVE'\n+ { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$ac_try\\\"\"; } >&5\n+ (eval $ac_try) 2>&5\n+ ac_status=$?\n+ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n+ test $ac_status = 0; }; } \\\n+ && ! { ac_try='LC_ALL=C $READELF -Wl conftest | grep -q INTERP'\n+ { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$ac_try\\\"\"; } >&5\n+ (eval $ac_try) 2>&5\n+ ac_status=$?\n+ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n+ test $ac_status = 0; }; }\n+ then\n+ libc_cv_static_pie_on_arm=yes\n+ fi\n+ rm -rf conftest* ;;\n+esac\n+fi\n+{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $libc_cv_static_pie_on_arm\" >&5\n+printf \"%s\\n\" \"$libc_cv_static_pie_on_arm\" >&6; }\n+if test \"$libc_cv_static_pie_on_arm\" = yes; then\n+ printf \"%s\\n\" \"#define SUPPORT_STATIC_PIE 1\" >>confdefs.h\n+\n+fi\n+\n # We check to see if the compiler and flags are\n # selecting the hard-float ABI and if they are then\n # we set libc_cv_arm_pcs_vfp to yes which causes\ndiff --git a/sysdeps/arm/configure.ac b/sysdeps/arm/configure.ac\nindex cd00ddc9d9..0c4f0f0de8 100644\n--- a/sysdeps/arm/configure.ac\n+++ b/sysdeps/arm/configure.ac\n@@ -1,6 +1,35 @@\n GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.\n # Local configure fragment for sysdeps/arm.\n \n+dnl Test if the foolchain supports static PIE, the -static-pie should not only\n+dnl be accepted, but also generate a ET_DYN without a INTERP entry.\n+AC_CACHE_CHECK([if compiler support static PIE],\n+libc_cv_static_pie_on_arm, [\n+cat > conftest.S <<\\EOF\n+.text\n+.global _start\n+.type _start,#function\n+_start:\n+\n+.data\n+.align 2\n+ptr:\n+ /* This shoul produce an R_ARM_RELATIVE. */\n+ .word _start\n+EOF\n+\n+ libc_cv_static_pie_on_arm=no\n+ if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static-pie -nostdlib -fPIE -o conftest conftest.S]) \\\n+ && AC_TRY_COMMAND([LC_ALL=C $READELF -Wr conftest | grep -q R_ARM_RELATIVE]) \\\n+ && ! AC_TRY_COMMAND([LC_ALL=C $READELF -Wl conftest | grep -q INTERP])\n+ then\n+ libc_cv_static_pie_on_arm=yes\n+ fi\n+ rm -rf conftest* ])\n+if test \"$libc_cv_static_pie_on_arm\" = yes; then\n+ AC_DEFINE(SUPPORT_STATIC_PIE)\n+fi\n+\n # We check to see if the compiler and flags are\n # selecting the hard-float ABI and if they are then\n # we set libc_cv_arm_pcs_vfp to yes which causes\ndiff --git a/sysdeps/arm/start.S b/sysdeps/arm/start.S\nindex a7e62b3934..68e032ef4d 100644\n--- a/sysdeps/arm/start.S\n+++ b/sysdeps/arm/start.S\n@@ -90,6 +90,7 @@ _start:\n \tpush { a1 }\n \n #ifdef PIC\n+# ifdef SHARED\n \tldr sl, .L_GOT\n \tadr a4, .L_GOT\n \tadd sl, sl, a4\n@@ -103,6 +104,16 @@ _start:\n \t/* __libc_start_main (main, argc, argv, init, fini, rtld_fini, stack_end) */\n \t/* Let the libc call main and exit with its return code. */\n \tbl __libc_start_main(PLT)\n+# else\n+\tldr a1, .L_main_rel\t/* Load the relative offset of main. */\n+\tadr a4, .L_main_rel\t/* Load the actual runtime address of the label. */\n+\tadd a1, a4, a1\t\t/* Add them together to get the absolute address. */\n+\n+\tmov a4, #0\t\t/* Used to be init. */\n+\tpush { a4 }\t\t/* Used to be fini. */\n+\n+\tbl __libc_start_main\n+# endif\n #else\n \n \tmov a4, #0\t\t/* Used to init. */\n@@ -119,9 +130,14 @@ _start:\n \n #ifdef PIC\n \t.align 2\n+# ifdef SHARED\n .L_GOT:\n \t.word _GLOBAL_OFFSET_TABLE_ - .L_GOT\n \t.word main(GOT)\n+# else\n+.L_main_rel:\n+\t.word main - .L_main_rel\n+# endif\n #endif\n \n .cantunwind\n", "prefixes": [] }