From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id 62B753858D32 for ; Mon, 8 Apr 2024 02:49:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 62B753858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 62B753858D32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712544549; cv=none; b=ph+K5DlrsxaqIlaygEqu2L1LLPHdJwAiT3UzzwlVMHdDJo8DBkvM4heb4nHlgcJsTrOGO7iHoedgu0r3Se/ix3wvaICya9H5b+yaSfdLIVON4TDP7ykMMqoyvFpQgGMDbqqzT2SFfWkxupJwN86Cd7pn8xBT3bB78f5h9bpKSyo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712544549; c=relaxed/simple; bh=ZkqhwwkZNGVBG4VpfAFthnTQMoAU0Faa9zFYesIZnCk=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=X7F1SF9iWZh4DLCCl9ycliFOr6/Z+WeTn0uzFuQ2mKa42ffjVAWJzI3vcOspNRTnxBwhZP+ATlKqrsTPssbffzOv+eGMp3PC0i8k7IUufsLugZu/YPIVpfY/UMDlVgGwQ0g793znUEKzXNP2szw5xlnPfsOOE4p9G03q9ZIh8jw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1e2178b2cf2so36440675ad.0 for ; Sun, 07 Apr 2024 19:49:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712544546; x=1713149346; darn=sourceware.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=yEkcHcHtL/KUTmyn0QCo0Zqwg5qSoxRyWBmeSGGGxco=; b=f7gc6zAdyA9Skt3L0b6vfJywYXW2LoTa9LAhDITVhjqChKZqI9JO7SBycVCSQ2p79Y GLafeNHdsWqJnykcYiiIqevaNiafnAngE8/KxeH4ZqTCz3U3pVr963mXpT6I8uZb2C35 /1NmgF5uMUBmTNRUep2nplXyG/pW3Zr0Tsd17MZNk6pFJ5iGSgr54HfSPiYhLZTS3JMC oO8qzTS5MCnNQNmCOwkcZu6rPvZA8M5wyehsbpASNzhTozFcUqI0J/Lm/lPh63x3ZdO9 oq6fzgmDVJ0MOtDanriCnWp7ZV8Mo4s93xEWG4QJgQCod1Zi/IMeMW4gmLL1PT+uTeoq qxPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712544546; x=1713149346; h=cc: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=yEkcHcHtL/KUTmyn0QCo0Zqwg5qSoxRyWBmeSGGGxco=; b=Mebah0naporL0jL9CuHgOEFlhfp1zrvXTwSFHL55HFQa1/AvuZBgAElDswLB26YLQ6 u71Lq30WAqTD4OdZD/yr1nZ37VQwWqKLsePlaBZsTcCWktlQTm6rULvxZ09CI+heSOyA hrsbq4zSVFD5UTfWmAODQFazcPwEo7Ht+IUHMradKP4MK9V/8f5Zz323qrH3ChiVuDel En3taEfwXv3D7FleB+t28iRbGRPQRMh6V3x08GUUMhFEimX53tjK9i8fh5x3Rb+kg3La NOo1T6iROYZLpH7Ej42kojmo0ziAD9L/Zc+LWmAQdtfwJFpZrHGxkuG5tNJqh9SkfT1t IIKQ== X-Forwarded-Encrypted: i=1; AJvYcCUaue1XrR57wc2ljOsnuXWBHX47Q8qkvOtykweq+lRBqpzzZi6cGBz8dFthhL0oAFlmQcsUpMaKQw33PKvUWI40xwrtDXChvSj3 X-Gm-Message-State: AOJu0Yw4nqZbeG723T8eWzNRImJP9I5F2yolkPIzYn+FjO8BdfCGmXa8 dpXh9pbLB6CxYP5vH8Gsg1dDabd1tNmEBEC1XUEOR5SWYtDgdawRBOplA8LkbvSoFsGPOziH4gt jTEy6RSVhRPY810sOojW3q6PKhzhsvhY7e0s= X-Google-Smtp-Source: AGHT+IF6IoB6EpSk+x37psnjmHfyxo3U9SA1HRF2dY1Y2faRMBp7IZz9zeGG/msFckl51r0u7JS7FyVSdYhGZQqJiN4= X-Received: by 2002:a17:90b:108c:b0:2a2:d498:eec2 with SMTP id gj12-20020a17090b108c00b002a2d498eec2mr6199799pjb.40.1712544545935; Sun, 07 Apr 2024 19:49:05 -0700 (PDT) MIME-Version: 1.0 References: <87plv91b22.fsf@oldenburg3.str.redhat.com> In-Reply-To: From: abush wang Date: Mon, 8 Apr 2024 10:48:54 +0800 Message-ID: Subject: Re: [PATCH] stdlib: reorganize stdlib Makefile routines by functionality To: "H.J. Lu" Cc: Florian Weimer , abushwang via Libc-alpha , adhemerval.zanella@linaro.org Content-Type: multipart/alternative; boundary="000000000000529db606158cd9fb" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000529db606158cd9fb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi H.J. Is there an updated version to solve this problem? On Tue, Apr 2, 2024 at 11:54=E2=80=AFAM abush wang w= rote: > Hi, Lu > it seems like there is some build issue: > ``` > /usr/bin/ld: /tmp/cc1NV6qZ.ltrans2.ltrans.o: warning: relocation against > `seen_eof_include_file' in read-only section `.text' > /usr/bin/ld: /tmp/cc1NV6qZ.ltrans1.ltrans.o: in function `lang_add_wild': > /builddir/build/BUILD/binutils-2.42.50/build-x86_64-redhat-linux/ld/../..= /ld/ldlang.c:8518:(.text+0xa108): > undefined reference to `in_text_section_ordering_file' > /usr/bin/ld: > /builddir/build/BUILD/binutils-2.42.50/build-x86_64-redhat-linux/ld/../..= /ld/ldlang.c:8552:(.text+0xa3aa): > undefined reference to `seen_eof_include_file' > /usr/bin/ld: > /builddir/build/BUILD/binutils-2.42.50/build-x86_64-redhat-linux/ld/../..= /ld/ldlang.c:8553:(.text+0xa3b8): > undefined reference to `in_text_section_ordering_file' > /usr/bin/ld: > /builddir/build/BUILD/binutils-2.42.50/build-x86_64-redhat-linux/ld/../..= /ld/ldlang.c:8551:(.text+0xa48f): > undefined reference to `in_text_section_ordering_file' > /usr/bin/ld: /tmp/cc1NV6qZ.ltrans2.ltrans.o: in function > `ldfile_open_command_file_1.lto_priv.0': > /builddir/build/BUILD/binutils-2.42.50/build-x86_64-redhat-linux/ld/../..= /ld/ldfile.c:939:(.text+0x9fc2): > undefined reference to `in_text_section_ordering_file' > /usr/bin/ld: > /builddir/build/BUILD/binutils-2.42.50/build-x86_64-redhat-linux/ld/../..= /ld/ldfile.c:965:(.text+0x9ff3): > undefined reference to `in_text_section_ordering_file' > /usr/bin/ld: > /builddir/build/BUILD/binutils-2.42.50/build-x86_64-redhat-linux/ld/../..= /ld/ldfile.c:998:(.text+0xa0e7): > undefined reference to `in_text_section_ordering_file' > /usr/bin/ld: > /builddir/build/BUILD/binutils-2.42.50/build-x86_64-redhat-linux/ld/../..= /ld/ldfile.c:995:(.text+0xa0f7): > undefined reference to `seen_eof_include_file' > /usr/bin/ld: warning: creating DT_TEXTREL in a PIE > collect2: error: ld returned 1 exit status > make[4]: *** [Makefile:1265: ld-new] Error 1 > make[3]: *** [Makefile:1903: all-recursive] Error 1 > make[2]: *** [Makefile:1092: all] Error 2 > make[1]: *** [Makefile:8046: all-ld] Error 2 > ``` > > test by binutils-2.42.50-6.fc41.src.rpm > this is my repo > https://mirrors.aliyun.com/fedora/development/rawhide/Everything/x86_64/o= s/ > I have verified that the error reported is caused by these patches. > > > On Mon, Apr 1, 2024 at 9:17=E2=80=AFPM H.J. Lu wrot= e: > >> On Mon, Apr 1, 2024 at 6:13=E2=80=AFAM Florian Weimer wrote: >> > >> > * abush wang: >> > >> > > This is test: >> > > ``` >> > > uint64_t getnsecs() { >> > > uint32_t lo, hi; >> > > __asm__ __volatile__ ( >> > > "rdtsc" : "=3Da"(lo), "=3Dd"(hi) >> > > ); >> > > return ((uint64_t)hi << 32) | lo; >> > > } >> > > >> > > int main() { >> > > const int num_iterations =3D 1; >> > > uint64_t start, end, total_time =3D 0; >> > > >> > > start =3D getnsecs(); >> > > for (int i =3D 0; i < num_iterations; i++) { >> > > (void) lrand48(); >> > > } >> > > end =3D getnsecs(); >> > > total_time +=3D (end - start); >> > > >> > > printf("Average time for lrand48: %lu cycles\n", total_time / >> num_iterations); >> > > return 0; >> > > } >> > > ``` >> > > before: >> > > Average time for lrand48: 21418 cycles >> > > >> > > after: >> > > Average time for lrand48: 9892 cycles >> > >> > Do you see this on x86-64? So this isn't a displacement range issue? >> > >> > It could be that this is a random performance change due to code >> > alignment, and not actually caused by the direct call distance. >> > >> >> I have a linker patch to control section layout: >> >> https://patchwork.sourceware.org/project/binutils/list/?series=3D29973 >> >> It can >> >> 1. Reduce gaps between text sections. >> 2. Put hot text sections close to each other. >> >> If it can solve this issue, we should add this feature to ld. >> >> -- >> H.J. >> > --000000000000529db606158cd9fb--