In full size these U shaped items are called staples. They are made in full size in a press tool. Wire is fed in between an upper punch and a lower die, usually sideways, to a fixed stop block. The die is a round topped former bar set on a die plate. Punch has a sharp lower edge which cuts the wire off (at an angle like a nail) as it descends to form the wire into a U over the die. Punch has a U shaped cavity to form the wire over the die. Inside the punch is a sping loaded pressure pad that holds the wire tight to the die so it does not slip during bending.
There is a second type of press tool called a link maker that can make chain links or staples. These work by passing wire horizontally through one or two rotating vertical formers. Think of a pair of pliers held vertical, jaws up. The pliers/former are rotated and two U shapes are formed in the wire, during first part of rotation the wire is cut off between former and a die. The formers are held in a very rigid heavy frame, and are often driven by gears and a rack. I have seen one where the formers are driven with a crank and connecting rods though, in a chain making shop at a steel mill.
If you had hundreds or thousands of staples to make, it might be worth making a simple punch and die set with pressure pad as in first paragraph above, to be used in an arbour press. You could use two vertical pins set in the die plate, engaged in holes in the punch plate, to ensure punch and die are aligned.
JD