I noticed that the value was wrong while adding some debug prints for some rtld changes for CHERI binaries.
`obj->textsize` only seems to be used by PPC so the effect is untested. However, the value before was definitely wrong and the new result matches the phdrs.