Provided is a method, system, and program for generating and communicating
information on locations of program sections in memory. Source code is
generated for an agent program. The source code includes start and end
variables for selected sections of the program, wherein the start and end
variables for each selected section are used to indicate the start and
end address in a memory at which the section is loaded. The selected
sections are capable of including less than all the sections in the
program. The source code is compiled and linked to generate an object
file including the sections. The object file causes, in response to being
loaded into the memory of a computer, a relocation of at least one of the
start and end memory addresses of the selected sections into at least one
of the start and end variables for the selected sections when memory
addresses are assigned to sections as part of relocation operations.
Other embodiments are disclosed and claimed.