1274 (attested in Anglo-L. from c.1189), from O.Fr. pellori (1168), from M.L. pilloria, of uncertain origin, perhaps a dim of L. pila "pillar, stone barrier." The verb is first attested 1600.
O.E. stocc "stump, post, stake, tree trunk, log," also "pillory" (usually plural, stocks), from P.Gmc. *stukkaz "tree trunk" (cf. O.N. stokkr "block of wood, trunk of a tree," O.S., O.Fris. stok, M.Du. stoc "tree trunk, stump," Du. stok "stick, cane," O.H.G. stoc "tree trunk, stick," Ger. Stock "stick, cane;" also Du. stuk, Ger. Stück "piece"), from PIE *(s)teu- (see steep (adj.)). Meaning "ancestry, family" (late 14c.) is a figurative use of the "tree trunk" sense (cf. family tree). This is also the root of the meaning "heavy part of a tool," and "part of a rifle held against the shoulder" (1540s). Stock, lock, and barrel "the whole of a thing" is recorded from 1817. Meaning "framework on which a boat was constructed" (early 15c.) led to figurative phrase on stocks "planned and commenced" (1660s). Stock-still (late 15c.) is lit. "as still as a tree trunk."