bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: objcopy --add-section doubt


From: kartikeyan sadasivuni
Subject: Re: objcopy --add-section doubt
Date: Sat, 28 Jan 2006 16:34:42 +0530

> error
> ----------------
> objcopy: can't create section `.skdata': File in wrong format
>
> If you need any more information please contact me.

I attached gdb to the objcopy program in the src/binutils/objcopy program

(gdb) n
1131      if (newsect->name != NULL)
(gdb) list
1126      sh = section_hash_lookup (&abfd->section_htab, name, TRUE, FALSE);
1127      if (sh == NULL)
1128        return NULL;
1129
1130      newsect = &sh->section;
1131      if (newsect->name != NULL)
1132        {
1133          /* Section already exists.  */
1134          return NULL;
1135        }
(gdb) p newsect->name
$1 = 0x9c635f5 ".skdata"


#0  bfd_make_section_with_flags (abfd=0x9c63af8, name=0x9c627f0
".skdata", flags=291) at section.c:1131
#1  0x0804ab92 in copy_object (ibfd=0x9c62a38, obfd=0x9c63af8) at objcopy.c:1316
#2  0x0804c1c7 in copy_file (input_filename=0xbfc7bb94 "a.out",
output_filename=0x9c62a28 "stJ11shK", input_target=Variable
"input_target" is not available.
) at objcopy.c:1884
#3  0x0804d54a in main (argc=6, argv=0xbfc7ab74) at objcopy.c:3172

so NULL is being returned as newsect->name is not NULL


I AM NOT A EXPERT IN BINUTILS.
I ALSO DON'T KNOW WHAT I AM IS THE RIGHT WAY TO DO IT.
BUTS ITS WORKING UNDER RH9.
SO I ASSUMED IT TO BE CORRECT.


I tried to comment out the NULL check and recompile and install.
Some other bug is coming (assertion failure)
So I gave up.

It seems the RH9 version of binutils replaced the contents of even a
existing section if --add-section is given
This doesn't seem to happen in latest binutils

---------------------------------------
If my logic is incorrect
please find time mailing the correction to me
------------------------------------------------------------------


--
S.Kartikeyan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]