Subject: Re: bin/33909: modload fails with "section .eh_frame ... overlaps
To: None <khym@azeotrope.org>
From: Matthias Drochner <M.Drochner@fz-juelich.de>
List: netbsd-bugs
Date: 07/06/2006 14:18:18
This is a multipart MIME message.

--==_Exmh_5678686875280
Content-Type: text/plain; charset=us-ascii


khym@azeotrope.org said:
> .eh_frame: addr = 0xa430 size = 0x16c0 align = 0x8
> .data: addr = 0x10bb00 size = 0x190 align = 0x20
> .data section forced to offset 0xbb00 (was 0x10bb00) 

My modload/elf.c patch wouldn't help here because .data
is already aligned as much as .text.

After some investigation I'm pretty sure the linker is
to blame. It does the overlap check too early. The
platform dependent "finish" function recalculates all
the sizes, so what gets checked is not the final result.

Could you try the appended fix?
(and discard the elf.c patch)

best regards
Matthias



--==_Exmh_5678686875280
Content-Type: text/plain ; name="ldchk.txt"; charset=us-ascii
Content-Description: ldchk.txt
Content-Disposition: attachment; filename="ldchk.txt"

Index: ldlang.c
===================================================================
RCS file: /cvsroot/src/gnu/dist/binutils/ld/ldlang.c,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 ldlang.c
--- ldlang.c	2 Feb 2006 21:18:10 -0000	1.1.1.3
+++ ldlang.c	6 Jul 2006 12:16:29 -0000
@@ -4876,14 +4876,15 @@ lang_process (void)
 
   lang_do_assignments (statement_list.head, abs_output_section, NULL, 0);
 
+  /* Final stuffs.  */
+
+  ldemul_finish ();
+
   /* Make sure that the section addresses make sense.  */
   if (! link_info.relocatable
       && command_line.check_section_addresses)
     lang_check_section_addresses ();
 
-  /* Final stuffs.  */
-
-  ldemul_finish ();
   lang_finish ();
 }
 

--==_Exmh_5678686875280--