[PATCH] ld: Add support for a new option, -exclude-symbols, in COFF object file directives

Martin Storsjö martin@martin.st
Wed Jul 20 15:10:31 GMT 2022


On Wed, 20 Jul 2022, Jan Beulich wrote:

> On 20.07.2022 14:39, Martin Storsjö wrote:
>> This directive isn't supposed to be used from a def file though (just like
>> the aligncomm directive), see the comment in deffile.h.
>
> Isn't supposed to be, or is prevented from being used that way? I have
> to admit that I'd find it quite helpful if this new option was also
> usable from a .def file. This might commonly be the more central place
> to record exclusions.

It's not possible to use it in a .def file with the current patch - it 
would need to be recognized as a token at the very least. Do you want me 
to try add support for that? I guess I could see a usecase for that too...

My intended usecase is to map __attribute__((visibility("hidden"))) and 
similar (-fvisibility=hidden and -fvisibility-inlines-hidden) to this 
embedded directive, in Clang/llvm. (Not sure how hard it would be to do 
the same in GCC, but I have a Clang patch ready for that.)

// Martin


More information about the Binutils mailing list