This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] x86: Keep __patchable_function_entries sections with --gc-sections
- From: Fangrui Song <i at maskray dot me>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Sat, 1 Feb 2020 09:34:29 -0800
- Subject: Re: [PATCH] x86: Keep __patchable_function_entries sections with --gc-sections
- References: <20200201162613.2023476-1-hjl.tools@gmail.com>
On 2020-02-01, H.J. Lu wrote:
After all text sections have been garbage collected, if a
__patchable_function_entries section references a section which
wasn't marked, mark it with SEC_EXCLUDE and return NULL. Otherwise,
keep it.
Should it be handled in _bfd_elf_gc_mark_extra_sections?
Thanks for paying attention to these feature requests.
I referenced GNU as and ld requests at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93492#c2
If we
* implement SHF_LINK_ORDER
* allow multiple sections with the same name ("unique")
* teach GCC to use SHF_LINK_ORDER and "unique" (see https://gcc.gnu.org/ml/gcc/2020-01/msg00067.html)
An ad-hoc gc marking will be unnecessary.
SHF_LINK_ORDER has been used in a few sanitizers. Now we know
__patchable_function_entries can benefit from it. In the future, they
may be instances. We really need a general solution.