We explore the elastic behavior of a wormlike chain under compression in terms of exact solutions for the associated probability densities. Strikingly, the probability density for the end-to-end distance projected along the applied force exhibits a bimodal shape in the vicinity of the critical Euler buckling force of an elastic rod, reminiscent of the smeared discontinuous phase transition of a finite system. These two modes reflect the almost stretched and the S-shaped configuration of a clamped polymer induced by the compression. Moreover, we find a bimodal shape of the probability density for the transverse fluctuations of the free end of a cantilevered polymer as fingerprint of its semiflexibility. In contrast to clamped polymers, free polymers display a circularly symmetric probability density and their distributions are identical for compression and stretching forces.