LD script optimization