From: abush wang <abushwangs@gmail.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Florian Weimer <fweimer@redhat.com>,
abushwang via Libc-alpha <libc-alpha@sourceware.org>,
adhemerval.zanella@linaro.org
Subject: Re: [PATCH] stdlib: reorganize stdlib Makefile routines by functionality
Date: Mon, 8 Apr 2024 10:48:54 +0800 [thread overview]
Message-ID: <CAMLoAPbxKiZa=gbUi6Cm+9f8Z3aEfHCptH8oa+5yEcTm_Z_jfw@mail.gmail.com> (raw)
In-Reply-To: <CAMLoAPZkG6qtpBvurM18+XMimqPTa_3QpnbG0s6TRnTW4wCuKg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 4081 bytes --]
Hi H.J.
Is there an updated version to solve this problem?
On Tue, Apr 2, 2024 at 11:54 AM abush wang <abushwangs@gmail.com> wrote:
> 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/os/
> I have verified that the error reported is caused by these patches.
>
>
> On Mon, Apr 1, 2024 at 9:17 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
>> On Mon, Apr 1, 2024 at 6:13 AM Florian Weimer <fweimer@redhat.com> wrote:
>> >
>> > * abush wang:
>> >
>> > > This is test:
>> > > ```
>> > > uint64_t getnsecs() {
>> > > uint32_t lo, hi;
>> > > __asm__ __volatile__ (
>> > > "rdtsc" : "=a"(lo), "=d"(hi)
>> > > );
>> > > return ((uint64_t)hi << 32) | lo;
>> > > }
>> > >
>> > > int main() {
>> > > const int num_iterations = 1;
>> > > uint64_t start, end, total_time = 0;
>> > >
>> > > start = getnsecs();
>> > > for (int i = 0; i < num_iterations; i++) {
>> > > (void) lrand48();
>> > > }
>> > > end = getnsecs();
>> > > total_time += (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=29973
>>
>> 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.
>>
>
[-- Attachment #2: Type: text/html, Size: 5385 bytes --]
next prev parent reply other threads:[~2024-04-08 2:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-01 11:47 [PATCH] stdlib: reorganize stdlib Makefile routines by functionality abush wang
2024-04-01 13:12 ` Florian Weimer
2024-04-01 13:17 ` H.J. Lu
2024-04-01 13:46 ` Adhemerval Zanella Netto
2024-04-02 3:54 ` abush wang
2024-04-08 2:48 ` abush wang [this message]
2024-04-02 2:17 ` abush wang
2024-04-02 2:28 ` abush wang
2024-04-02 3:13 ` H.J. Lu
2024-04-02 6:18 ` abush wang
2024-04-02 14:15 ` Adhemerval Zanella Netto
2024-04-03 1:57 ` abush wang
-- strict thread matches above, loose matches on Subject: below --
2024-04-01 11:44 abushwang
2024-04-01 12:03 ` Xi Ruoyao
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
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAMLoAPbxKiZa=gbUi6Cm+9f8Z3aEfHCptH8oa+5yEcTm_Z_jfw@mail.gmail.com' \
--to=abushwangs@gmail.com \
--cc=adhemerval.zanella@linaro.org \
--cc=fweimer@redhat.com \
--cc=hjl.tools@gmail.com \
--cc=libc-alpha@sourceware.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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).