O.E. geloma "utensil, tool," from ge- perfective prefix + -loma, of unknown origin. Originally "implement or tool of any kind" (cf. heirloom); thus, "the penis" (c.1400-1600). Meaning "a machine in thich yarn or thread is woven into fabric" is from 1404.
1540s, perhaps from a Scandinavian source (cf. dial. Swed. loma, E.Fris. lomen "move slowly"), perhaps a variant from the root of lame (adj.); first used of ships.