[PATCH] Introduce new .text.sorted.* sections.

Cary Coutant ccoutant@gmail.com
Mon Nov 25 21:04:00 GMT 2019


> 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



More information about the Binutils mailing list