Re: [uClinux-dev] [PATCH] elf2flt.ld: give .note.ABI-tag its own output section

2010-12-16 Thread Mike Frysinger
On Wednesday, December 15, 2010 20:40:14 David McCullough wrote:
 I thought that if it's not needed in the flat file,  perhaps you should
 have put it lower in the ld script like the .debug sections etc,  that way
 it will not get pushed into the text/data of the flat executable but should
 still be in the elf file for debugging etc ?

i tried that originally, but kept getting linker errors.  i think it's because 
the section has the alloc (A) flag on it since on ELF systems, it does get 
loaded and possibly checked at runtime.  to get the FLAT file to discard it, i 
think we'd have to be a little more tricky ?  perhaps create a new program 
header named discard and have the elf2flt utility always ignore the last 
program header ?
-mike


signature.asc
Description: This is a digitally signed message part.
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Re: [uClinux-dev] [PATCH] elf2flt.ld: give .note.ABI-tag its own output section

2010-12-16 Thread David McCullough

Jivin Mike Frysinger lays it down ...
 On Wednesday, December 15, 2010 20:40:14 David McCullough wrote:
  I thought that if it's not needed in the flat file,  perhaps you should
  have put it lower in the ld script like the .debug sections etc,  that way
  it will not get pushed into the text/data of the flat executable but should
  still be in the elf file for debugging etc ?
 
 i tried that originally, but kept getting linker errors.  i think it's 
 because 
 the section has the alloc (A) flag on it since on ELF systems, it does get 
 loaded and possibly checked at runtime.  to get the FLAT file to discard it, 
 i 

Ok.

 think we'd have to be a little more tricky ?  perhaps create a new program 
 header named discard and have the elf2flt utility always ignore the last 
 program header ?


If you are happy with it where it is then I won't complain ;-)

Cheers,
Davidm

-- 
David McCullough,  david_mccullo...@mcafee.com,  Ph:+61 734352815
McAfee - SnapGear  http://www.mcafee.com http://www.uCdot.org
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] [PATCH] elf2flt.ld: give .note.ABI-tag its own output section

2010-12-16 Thread Mike Frysinger
On Thursday, December 16, 2010 16:56:56 David McCullough wrote:
  On Wednesday, December 15, 2010 20:40:14 David McCullough wrote:
   I thought that if it's not needed in the flat file,  perhaps you should
   have put it lower in the ld script like the .debug sections etc,  that
   way it will not get pushed into the text/data of the flat executable
   but should still be in the elf file for debugging etc ?
  
  i tried that originally, but kept getting linker errors.  i think it's
  because the section has the alloc (A) flag on it since on ELF systems,
  it does get loaded and possibly checked at runtime.  to get the FLAT
  file to discard it, i
 
 Ok.
 
  think we'd have to be a little more tricky ?  perhaps create a new
  program header named discard and have the elf2flt utility always
  ignore the last program header ?
 
 If you are happy with it where it is then I won't complain ;-)

i would love to get it discarded from the FLAT file, but i cant think of any 
simple answers.  if you have better ideas, we can take a look ...
-mike


signature.asc
Description: This is a digitally signed message part.
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Re: [uClinux-dev] [PATCH] elf2flt.ld: give .note.ABI-tag its own output section

2010-12-16 Thread David McCullough
Jivin Mike Frysinger lays it down ...
 On Thursday, December 16, 2010 16:56:56 David McCullough wrote:
   On Wednesday, December 15, 2010 20:40:14 David McCullough wrote:
I thought that if it's not needed in the flat file,  perhaps you should
have put it lower in the ld script like the .debug sections etc,  that
way it will not get pushed into the text/data of the flat executable
but should still be in the elf file for debugging etc ?
   
   i tried that originally, but kept getting linker errors.  i think it's
   because the section has the alloc (A) flag on it since on ELF systems,
   it does get loaded and possibly checked at runtime.  to get the FLAT
   file to discard it, i
  
  Ok.
  
   think we'd have to be a little more tricky ?  perhaps create a new
   program header named discard and have the elf2flt utility always
   ignore the last program header ?
  
  If you are happy with it where it is then I won't complain ;-)
 
 i would love to get it discarded from the FLAT file, but i cant think of any 
 simple answers.  if you have better ideas, we can take a look ...

Pretty sure you tried this one:


Index: elf2flt.ld.in
===
RCS file: /var/cvs/elf2flt/elf2flt.ld.in,v
retrieving revision 1.5
diff -u -1 -r1.5 elf2flt.ld.in
--- elf2flt.ld.in   16 Dec 2010 01:37:41 -  1.5
+++ elf2flt.ld.in   16 Dec 2010 23:52:42 -
@@ -138,3 +138,2 @@
 
-   .note.ABI-tag : { *(.note.ABI-tag) }  flatmem
.eh_frame_hdr : { *(.eh_frame_hdr) }  flatmem
@@ -209,2 +208,3 @@
.debug_varnames  0 : { *(.debug_varnames) }
+   .note.ABI-tag 0 : { *(.note.ABI-tag) }
 }


Another option may be to leave it out,  then add a .note.ABI-tag using
objcopy as part of the ld-elf2flt processing.  Bit of a hack I know,  but
gets it out of the flatfile,  also gives you control over what goes into the
.note.ABI-tag in terms of kernel versions etc.

Actually,  that probably won't work as you said linker errors.  How about
using a copy of the XYZ.elf file in ld-elf2flt that has the .note.ABI-tag
removed ?

Cheers,
Davidm

-- 
David McCullough,  david_mccullo...@mcafee.com,  Ph:+61 734352815
McAfee - SnapGear  http://www.mcafee.com http://www.uCdot.org
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


[uClinux-dev] [PATCH] elf2flt.ld: give .note.ABI-tag its own output section

2010-12-15 Thread Mike Frysinger
The .note.ABI-tag section exists to indicate to other projects (like gdb
or library loaders) information about the target OS.  It doesn't actually
contain anything that is used at runtime.  So while the current linker
script gathers this into the .data section, the final FLAT doesn't include
anything from it.  But tools expect to find a dedicated section in ELFs
which the current section merge prevents.

So give .note.ABI-tag its own output section so gdb can locate and use it.
This shouldn't change the FLAT files produced in any way.

Signed-off-by: Mike Frysinger vap...@gentoo.org
---
 elf2flt.ld.in |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/elf2flt.ld.in b/elf2flt.ld.in
index 6871ae9..c7e01a6 100644
--- a/elf2flt.ld.in
+++ b/elf2flt.ld.in
@@ -81,7 +81,6 @@ R_RODAT   *(.gnu.linkonce.r*)
*(__libc_atexit)
*(__libc_subinit)
*(__libc_subfreeres)
-   *(.note.ABI-tag)
 
/* microblaze-specific read-only small data area
   and associated locating symbols */
@@ -137,6 +136,7 @@ TOR:@symbol_pre...@__dtor_end__ = .;
PROVIDE (@symbol_pre...@__fini_array_end = .);
}  flatmem :data
 
+   .note.ABI-tag : { *(.note.ABI-tag) }  flatmem
.eh_frame_hdr : { *(.eh_frame_hdr) }  flatmem
.eh_frame : { KEEP(*(.eh_frame)) }  flatmem
.gcc_except_table : {
-- 
1.7.3.3

___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] [PATCH] elf2flt.ld: give .note.ABI-tag its own output section

2010-12-15 Thread David McCullough

Jivin Mike Frysinger lays it down ...
 The .note.ABI-tag section exists to indicate to other projects (like gdb
 or library loaders) information about the target OS.  It doesn't actually
 contain anything that is used at runtime.  So while the current linker
 script gathers this into the .data section, the final FLAT doesn't include
 anything from it.  But tools expect to find a dedicated section in ELFs
 which the current section merge prevents.
 
 So give .note.ABI-tag its own output section so gdb can locate and use it.
 This shouldn't change the FLAT files produced in any way.
 
 Signed-off-by: Mike Frysinger vap...@gentoo.org
 ---
  elf2flt.ld.in |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/elf2flt.ld.in b/elf2flt.ld.in
 index 6871ae9..c7e01a6 100644
 --- a/elf2flt.ld.in
 +++ b/elf2flt.ld.in
 @@ -81,7 +81,6 @@ R_RODAT *(.gnu.linkonce.r*)
   *(__libc_atexit)
   *(__libc_subinit)
   *(__libc_subfreeres)
 - *(.note.ABI-tag)
  
   /* microblaze-specific read-only small data area
  and associated locating symbols */
 @@ -137,6 +136,7 @@ TOR:  @symbol_pre...@__dtor_end__ = .;
   PROVIDE (@symbol_pre...@__fini_array_end = .);
   }  flatmem :data
  
 + .note.ABI-tag : { *(.note.ABI-tag) }  flatmem
   .eh_frame_hdr : { *(.eh_frame_hdr) }  flatmem
   .eh_frame : { KEEP(*(.eh_frame)) }  flatmem
   .gcc_except_table : {

Applied.

I thought that if it's not needed in the flat file,  perhaps you should
have put it lower in the ld script like the .debug sections etc,  that way
it will not get pushed into the text/data of the flat executable but should
still be in the elf file for debugging etc ?

Cheers,
Davidm

-- 
David McCullough,  david_mccullo...@mcafee.com,  Ph:+61 734352815
McAfee - SnapGear  http://www.mcafee.com http://www.uCdot.org
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev