TOKYO, July 17 (Reuters) - Japan's Nikkei share average surrendered most of its early gains on Wednesday, as investors sold heavyweight chip-related stocks to book profits.

The Nikkei was up 0.08% at 41,307.36 by the midday break, after rising as much as 0.46% earlier in the session on Wall Street's strong finish overnight.

Wall Street stocks rose and the Dow Jones Industrial Average hit an all-time closing high on Tuesday after U.S. retail sales data supported the view that the Federal Reserve is approaching its easing cycle.

Investors sold chip-related shares, which had been behind the Nikkei's recent rally, as they shifted their focus to other stocks, said Shuutarou Yasuda, a market analyst at Tokai Tokyo Intelligence Laboratory.

Yasuda, however, said the market was firm and that was reflected in the gains of the Topix index.

The broader Topix was up 0.47% at 2,918.18.

Defence-related stocks extended their gains from the previous session, with Kawasaki Heavy Industries and Hitachi Zosen up 8.43% and 8.12% respectively, as higher chances of Donald Trump winning the U.S. presidential race spurred so-called "Trump trades."

Toho surged 11.09% after the film and entertainment company said its net profit jumped 31% in the latest quarter.

All but three of the Tokyo Stock Exchange's 33 industry sub-indexes rose, with the textiles sector gaining 2.03% to become the top performer. The property sector rose 1.67%.

Chip-making equipment maker Tokyo Electron slipped 3.1%, weighing on the Nikkei the most. Chip-testing equipment maker Advantest fell 0.81%.

Of the 225 components on the Nikkei, 172 stocks rose and 49 fell, with four trading flat. (Reporting by Junko Fujita; Editing by Subhranshu Sahu)