Weapon racks are a type of furniture which can be used to create a barracks or to appease a noble's demand or raise the value of a room.
When used in a barracks designated for Individual Equipment storage, dwarves will prefer to store their weapons on the racks instead of stockpiles. Doing so in concert with armor stands will allow you to create centralized armories for your military.
Stockpiles take priority over all armory storage, ensuring that weapon racks will never be used for anything.
The current version of DFHack (r3) has scripts that repair armory behavior.