When I created a memory graph for a program that uses strcat, the memory graph looks different when the definition for strcat is linked and unlinked. strcat takes two strings (s1 and s2), adds s2 to s1 and outputs s1. As a result, in the memory graph, the output points to the same box as the input and the box is labeled "Sequence SM". I was able to get %2(s1) and %8(output) to point to the same box by creating the following stub function:
However, the box is still labeled SM instead of Sequence SM. There should be a way to assign this label so that the stub can properly model the way strcat uses memory.
When I created a memory graph for a program that uses strcat, the memory graph looks different when the definition for strcat is linked and unlinked. strcat takes two strings (s1 and s2), adds s2 to s1 and outputs s1. As a result, in the memory graph, the output points to the same box as the input and the box is labeled "Sequence SM". I was able to get %2(s1) and %8(output) to point to the same box by creating the following stub function:
However, the box is still labeled SM instead of Sequence SM. There should be a way to assign this label so that the stub can properly model the way strcat uses memory.
Here are the memory graphs: linked.pdf unlinked.pdf
stub.pdf Corresponding .ll file for stub.pdf: strcat_stub.zip