If liquid fueled rocket motors can gimbal, how do solid rocket motor-propelled spacecraft control their attitude, especially when performing a "pad avoidance maneuver" directly after ignition?
The Ares 1-X used stock Shuttle program SRB thrust vector control (TVC) - hydrazine fueled power units drove hydraulic pumps which powered actuators that could tilt and rock the nozzle, which incorporated a flexible bearing in its design.
(Pictures from "Space Shuttle", Jenkins, 1992 edition p.263 and here - p 2.13-48 of linked PDF)
However, unlike the Shuttle system with its 2 SRBs, a single SRB with articulating nozzle cannot provide roll control, only pitch and yaw. So Ares 1-X had 2 unique modules containing hypergolic thrusters (derived from the Peacekeeper missile) mounted on it to provide control in the roll axis.
(Picture from here)
Apart from having an actuated nozzle, an inert gas or reactive liquid can be injected into the nozzle of an SRB to dynamically deflect or shape the exhaust, thereby vectoring the thrust.
ISRO's Polar Satellite Launch Vehicle (PSLV) uses strontium perchlorate from N2 pressure-fed tanks attached on side of core introduced into the SRB exhaust through an array of injectors around the exhaust nozzle. The Secondary Injection Thrust Vector Control (SITVC) system is shown on page 8 of the Oct-92-Mar-93 issue of Space India (PDF,Pg. 8), and is shown below, where engineers can be seen working on the ring of injectors near the top of the nozzle.
SITVC is also present on a few of the strapon SRBs of PSLV; two strapons (PSOM-4,5) in PSLV-XL and one in PSLV-G.
Similarly, N2O4 powered Liquid injection thrust vector control (LITVC) was used on Titan IIIC.
Solid rocket booster nozzles can gimbal. If you take the SRB of the Space Shuttle:
Each SRB had two hydraulic gimbal servoactuators, to move the nozzle up/down and side-to-side. This provided thrust vectoring to help control the vehicle in all three axes (roll, pitch, and yaw).
You will find more explanation on this Wikipedia article, where I found this picture:
In addition, rockets can board several devices, as: