Subject: re: ELF alignment: linker problem or not?
To: None <M.Drochner@fz-juelich.de>
From: matthew green <mrg@eterna.com.au>
List: tech-toolchain
Date: 07/07/2006 08:41:48
   
   mrg@eterna.com.au said:
   > what happens when you do not output .eh_frame at all?  (ie, i guess
   > use flags to ld or objcopy to remove it.) 
   
   I haven't found the right flag to gcc or ld yet.

it seems objcopy -R (which you already found) is what i meant.
   
   Anyway, I've removed that section with objcopy later, and the
   module loads now. I had to find out however that the problem
   isn't easy to reproduce, it is just one out of ten modules
   which exhibit the "overlap" problem at all. (I was just lucky
   that the first one I tried was one of these.) It must be a
   subtle combination of section lengths modulo alignment which
   triggers this.
   I believe that the overlap problem is not related to the
   existence of .eh_frame. That section is not handled specially
   by the linker as far as address allocation and alignment
   are concerned. And I had the linker code instrumented and
   found that section lengths indeed change during ldemul_finish(),
   so I think my statement about ld checking too early is correct.

this may be right.  in any case, we shouldn't put .eh_frame section
into the kernel text -- it is just totally wrong.