Baby cry when he is pooping

So my baby is don’t cry unless he is pooping. There can be as much noise, loud music no crying. But when he’s pooping or have gas he cries. Anyone else with this issue? Sorry I didn’t know what group to post this on! I’m in postpartum so I figure this is appropriate. Sorry if I’m not in the right group for this discussion. He is only 3 weeks old. How can I help him make his poop feel better? Is it what I’m eating thats the problem?