[PATCH 2/4] include, libctf, ld: extend variable section to contain functions too

Nick Alcock nick.alcock@oracle.com
Wed Mar 23 13:54:15 GMT 2022


On 21 Mar 2022, Nick Alcock via Binutils verbalised:

> The CTF variable section is an optional (usually-not-present) section in
> the CTF dict which contains name -> type mappings corresponding to data
> symbols that are present in the linker input but not in the output
> symbol table: the idea is that programs that use their own symbol-
> resolution mechanisms can use this section to look up the types of
> symbols they have found using their own mechanism.

Tested (a *lot*, because of the changes to the writeout path) and pushed
this series. (Hopefully that's not a problem without review: even though
it touches ld/, it only touches bits of ld/ related purely to ctf
testing)

Pushed, with the following addition to libctf/NEWS:

> Changes in 2.39:
> 
> * New features
> 
> ** The CTF variable section (if generated via ld --ctf-variables) now contains
>    entries for static functions, hidden functions, and other functions with
>    no associated symbol.  The associated type is of kind CTF_K_FUNCTION.
>    (No change if --ctf-variables is not specified, which is the default.)

(LIBCTF_WRITE_FOREIGN_ENDIAN, being a debugging option, doesn't rate a
NEWS entry.)

(This push should also fix Sourceware bug 28933, and add enough testing
infrastructure to be sure it doesn't recur.)


More information about the Binutils mailing list