External linkage functions which allocate memory

Hi All,

In a linked LLVM-IR module, I would like to know if any of the functions with external linkage allocate memory. The definitions of these functions are not available in the linked IR. For example, the ‘strdup’ function.

If I understand the definition of ‘readnone’ attribute correctly, I think one way to do this is to check if the function declaration has ‘readnone’ attached to it [1]. Is this correct?

Please let me know if there are any other reliable methods to do the same.

[1] https://llvm.org/docs/LangRef.html

Regards,
Raghesh

Hi All,

A correction in my query.

Please ignore this part → “if any of the functions with external linkage allocate memory”. I think I have not used the term “external linkage” promptly as per its definition.

What I would like to know is about the possibility of memory allocation by those functions whose definitions are not there in the linked LLMV-IR.

Regards
Raghesh