Matt Garza had some friendly advice for Jeff Samardzija, saying his former teammate needs to "pitch your way out of there" if he doesn't want to stay with the Chicago Cubs.

Garza spent parts of three seasons with the Cubs before being traded to the Texas Rangers last season. The right-hander was asked Saturday about Samardzija, who is set to become a free agent after the 2015 season and has been mentioned in multiple trade rumors. Garza was seen chatting with Samardzija before the game.

Jeff Samardzija, who was unable to reach a long-term deal with the Cubs this offseason, could be a trade chip later this summer. Dilip Vishwanat/Getty Images

"All I can tell him is keep pitching -- pitch your way out of it," Garza, who signed with the Milwaukee Brewers this offseason, told reporters. "Keep your eyes focused, your eyes straight ahead and just pitch. There's nothing else you can do."

Samardzija is winless in five starts this season despite pitching to a 1.53 ERA for the Cubs, who entered play Sunday with a 7-16 record -- the second-worst mark in the majors.

Chicago struggled through the worst three-year period in franchise history from 2011 to 2013, although Garza went 21-18 with a 3.45 ERA with the Cubs over that stretch.

"I told [Samardzija], 'It doesn't matter, dude. You play in Chicago,'" Garza told reporters. "'I was there, and I lost 30 wins in three seasons. It's not your fault. You pitch your way out of there.'"

The Cubs have a talent-laden farm system but also own the 23rd-highest payroll in the majors this season at $89 million.