An LD file is a script written in the GNU "linker command language." It contains one or more commands that are used to configure how input files storing static object code are to be compiled into a single executable program or library for the GNU operating system.
You will most likely only encounter LD scripts if you are compiling code into a program or library output file in GNU. The files are utilized by ld, which is a GNU linker command-line tool used to combine input files into an output file. Linking is part of the compilation process when building source code files into an output executable file. The ld command is often used as the last part of the compilation process to build the final executable.
While LD files may store multiple types of commands, they most often store the SECTIONS command, which specifies how the sections in multiple input files should be mapped to a single output file. This helps control the memory layout of the single output file. Only one SECTIONS command can be stored in an LD file but it may include multiple statements that can define an entry point, assign value to a symbol, or describe the placement of an output section and the input sections that go into it.
LD files are saved in plain text. You can use various text editors, such as Microsoft Notepad, Apple TextEdit, and gedit to view and edit them.
NOTE: The ld GNU linker is part of the GNU Binary Utilities (binutils).