https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61044
--- Comment #9 from Georg-Johann Lay <gjl at gcc dot gnu.org> --- (In reply to Senthil Kumar Selvaraj from comment #3) > The primary reason I added the diff relocs was to prevent linker relaxation > messing up DWARF line number information - as you know, relaxation can > shorten instruction sequences, and the addresses in DWARF then go out of > sync. > > I guess I must add some user documentation about this, but ideally, this is > supposed to be transparent to the user - just passing -mrelax to the > compiler should work. > > I turned diff reloc generation on only if -mlink-relax is passed because > this is what other ports (xtensa) do, and I wasn't sure of the consequences > of resolving every subtraction expression at link time. Resolving label differences at assemble time serves a faster linking process, but that argument does not apply to avr: We don't have magabytes of code that have to be fixed at load time by a dynamic linker. And you don't know at assemble time how the linker is called. One example is debugging through code that comes from a library and has been linked against the application. It's not very common but possible and yet another plus (besides simplicity with less options and less GCC/Binutils dependency) for always emitting label differences as relocs.