This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Introduce new .text.sorted.* sections.
- From: Cary Coutant <ccoutant at gmail dot com>
- To: Martin Liška <mliska at suse dot cz>
- Cc: Alan Modra <amodra at gmail dot com>, Binutils <binutils at sourceware dot org>, Ian Lance Taylor <iant at golang dot org>
- Date: Mon, 25 Nov 2019 13:04:02 -0800
- Subject: Re: [PATCH] Introduce new .text.sorted.* sections.
- References: <caa076c6-e356-f5e3-756d-eb1bbf498293@suse.cz> <20190925133427.GE19242@bubble.grove.modra.org> <501c6840-5c5f-2610-d0f9-aec269d07fda@suse.cz> <20190927074857.GC15102@bubble.grove.modra.org> <b19575b8-0524-6837-d081-1019e392b139@suse.cz> <e3625344-8771-fc66-6b4f-9cd1f94c211a@suse.cz> <CAJimCsHRYYagtDrkARsGGAOkk+sXWpDAJW=kmD0zff=at3Ui2A@mail.gmail.com> <8d195e8c-a297-8ce9-2fa1-c5ce5e3eec29@suse.cz>
> Ok, based on the review, I decided to come up with a special logic
> in Input_section_sort_section_prefix_special_ordering_compare. The function
> uses strcmp, so one can happily use any .text.sorted.FOO names.
+ else if (strstr(s1_section_name, ".text.sorted") == s1_section_name)
+ return strcmp(s1_section_name, s2_section_name) <= 0;
I think you meant to use is_prefix_of (which uses strncmp) instead of
strstr. As written, it'll match section names like
".foo.text.sorted.bar", and will take longer.
OK with that change. Thanks!
-cary