We consider a subclass of p-ary self-reversible generalized (L, G) codes with a locator set \(L=\{ \frac{2x-\alpha }{x^2-\alpha x +1},\alpha \in \mathbb {F}_q \setminus \{0\}, q=p^m \} \cup \{\frac{1}{x+1}\}\) , where p is a prime number. The numerator \(2x-\alpha \) of a rational function is the formal derivative of the denominator \(x^2-\alpha x +1\) . The Goppa polynomial \(G(x) \in \mathbb {F}_q[x]\) of degree 2t, t being odd, is either an irreducible self-reversible polynomial of degree 2t, or a non-irreducible self-reversible polynomial of degree 2t of the form \(G_1^{-1}(0)\cdot G_1(x)\cdot x^t\cdot G_1(x^{-1})\) , where \(G_1(x)\in \mathbb {F}_q[x]\) is any irreducible non self-reversible polynomial of degree t. Estimates for minimum distance and redundancy are obtained for codes from this subclass. It is shown that among these codes, there are codes lying on the Gilbert–Varshamov bound. As a special case, binary codes from this subclass that contains codes lying also on Gilbert–Varshamov bound are considered.