Steven Laitz calls this a common-tone diminished seventh chord, which is labeled "c.t.o7 to distinguish it from other uses of diminished chords.1 (See also Wikipedia's Diminished Seventh chord: other functions.) Its function is to "maintain the root of the harmony they extend".2 Here is a reproduction of Laitz's Example 35.17A, which illustrates the process:
T:Steven Laitz, The Complete Musician, 2008
T:Example 35.17A (p. 820)
%%score V1 (V2 V3)
[V:V1] "A:"y "I"E y "c.t.o7/V"E- y "V43"E
[V:V2 clef=bass] y [A,C] y [=G,C] y [^G,D]
[V:V3 clef=bass] y A,, y ^A,, y B,,
1 Laitz, Steven G, 2008, The Complete Musician, New York: Oxford University Press, p. 820. Laitz is not alone in this. For example, see Aldwell, Edward, and Carl Schachter, 1989, Harmony and Voice Leading, 2nd ed., Fort Worth: Harcourt Brace Jovanovich College Publishers, pp. 516–519.
2 Ibid. (Laitz's italics).