In this paper, we introduce self-dual codes relative to certain symmetric bilinear forms over a finite commutative ring. By refining the gluing theory of Conway, Pless, and Sloane, we obtain a gluing technique for constructing relatively self-dual codes. As examples of application of our technique, we find a construction of a self-dual binary [2(m + 3), m + 3, 6]-code from a self-dual [2m, m,
... [Show full abstract] l]-code with l⩾6, and a construction of doubly-even binary self-dual [2(m + 4), m + 4, 8]-code from a doubly even self-dual [2m, m, t]-code with t ⩾ 8.