This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: strip --strip-nondebug


Hi Elena,

>  > What is this section and how is it supposed to get into the stripped
>  > executable ?
>
> The strip utility does it.

Ah - I was afraid of that.  You see what I had hoped was that the GNU
strip program would only ever have to produce *one* output file at a
time.  So you could use one command to strip an executable and a
second command to create a debug-info file for that executable, rather
than trying to do both things at once.  (Which would mean a lot more
changes to the internals of strip, something I was trying to avoid).

If "--only-keep-debug" (my suggested new name for the --strip-nondebug
switch) has to produce a debug-info file *and* a stripped executable
with an extra .gnu_debuglink section in it, then it gets rather
complicated...

Of course we could have a five stage process:

  1. strip --strip-debug foo.exe -o foo.exe.stripped
  2. strip --only-keep-debug foo.exe -o foo.dbg
  4. echo foo.dbg > debug_link
  3. objcopy --add-section .gnu_debuglink=debug_link foo.stripped
  5. rm debug_link

I'll give it a go and see what happens.


> BTW, I find it a bit silly that a non-gnu utility decided to use the
> .gnu_debuglink name. Maybe you should call it somethign different,
> and gdb can look for both names?

I have no problem with the name.  In fact I am very happy to keep
calling it .gnu_debuglink.  This assumes of course that there is some
documentation as to the exact format of the contents of this
section...

Cheers
        Nick
        


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]