The government bought the rights to O Canada for $1

O Canada was originally composed in 1880 with French lyrics. Several English versions were written between 1900 and 1920, with (an edited version of) Robert Stanley Weir's lyrics finally winning out.

By the time the Canadian government got around to making it the official anthem the music and French lyrics were in the public domain, but the government had to buy the rights to the English lyrics.

The copyright to Weir's text had passed to Leo Feist Ltd. in 1929 and to Gordon V. Thompson Music in 1932. However, Weir’s heirs did not approve of the change to the lyrics, and though their legal standing was questionable, the government chose to settle the matter amicably. In 1970, both Thompson and Weir's descendants surrendered their rights to the Canadian government for the symbolic sum of one dollar.
— The Canadian Encyclopedia [1]

The music, English, and French lyrics are all declared to be in the public domain by the National Anthem Act [2]. This seems like it would be a moot point nowadays since their copyrights would all have expired by now, but the law does confirm that the 2018 change of "all our sons" to "all of us" did not change the copyright status.

  1. “O Canada”. The Canadian Encyclopedia. Helmut Kallmann and Gilles Potvin (2012). ↩︎

  2. National Anthem Act. RSC 1985, c N-2. Canada (1980). ↩︎