Please, see cfi-directives
It should cover history and theory of most of the sections in question.
About eh_frame, it contains exception unwinding and source language information. Each entry in this section is represented by single CFI (call frame information )
see, eh_frame in linuxfoundation
eh_frame_hdr, is used by c++ runtime code to access the eh_frame. That means, it contains the pointer and binary search table to efficiently retrieve the information from eh_frame.
Now, in case you want to see how you read/write this sections then I suggest take a look at following linker code.
(look for EhFrame.cpp, EhFrameHdr.cpp and EhFrameReader.cpp )
Good luck !!