public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PATCH: objdump: Skip linker created section
@ 2005-04-17 14:37 H. J. Lu
  2005-04-19 18:15 ` James E Wilson
  2005-04-20  9:26 ` Nick Clifton
  0 siblings, 2 replies; 4+ messages in thread
From: H. J. Lu @ 2005-04-17 14:37 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 803 bytes --]

I checked a objdump patch to support SEC_GROUP. Should objdump skip
linker created section? Readelf doesn't display it.


H.J.
----
2005-04-17  H.J. Lu  <hongjiu.lu@intel.com>

	* objdump.c (dump_section_header): Skip linker created section.

--- binutils/objdump.c.grp	2005-04-04 09:58:38.000000000 -0700
+++ binutils/objdump.c	2005-04-17 07:27:08.000000000 -0700
@@ -300,6 +300,11 @@ dump_section_header (bfd *abfd, asection
   char *comma = "";
   unsigned int opb = bfd_octets_per_byte (abfd);
 
+  /* Ignore linker created section.  See elfNN_ia64_object_p in
+     bfd/elfxx-ia64.c.  */
+  if (section->flags & SEC_LINKER_CREATED)
+    return;
+
   printf ("%3d %-13s %08lx  ", section->index,
 	  bfd_get_section_name (abfd, section),
 	  (unsigned long) bfd_section_size (abfd, section) / opb);

[-- Attachment #2: binutils-group-1.patch --]
[-- Type: text/plain, Size: 504 bytes --]

2005-04-17  H.J. Lu  <hongjiu.lu@intel.com>

	* objdump.c (dump_section_header): Support SEC_GROUP.

--- binutils/objdump.c.grp	2005-04-04 09:58:38.000000000 -0700
+++ binutils/objdump.c	2005-04-17 07:27:08.000000000 -0700
@@ -337,6 +342,7 @@ dump_section_header (bfd *abfd, asection
   if (bfd_get_flavour (abfd) == bfd_target_coff_flavour)
     PF (SEC_COFF_SHARED, "SHARED");
   PF (SEC_THREAD_LOCAL, "THREAD_LOCAL");
+  PF (SEC_GROUP, "GROUP");
 
   if ((section->flags & SEC_LINK_ONCE) != 0)
     {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PATCH: objdump: Skip linker created section
  2005-04-17 14:37 PATCH: objdump: Skip linker created section H. J. Lu
@ 2005-04-19 18:15 ` James E Wilson
  2005-04-19 19:17   ` H. J. Lu
  2005-04-20  9:26 ` Nick Clifton
  1 sibling, 1 reply; 4+ messages in thread
From: James E Wilson @ 2005-04-19 18:15 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

On Sun, 2005-04-17 at 07:37, H. J. Lu wrote:
> Should objdump skip
> linker created section? Readelf doesn't display it.

readelf does not display the section because it doesn't exist in the
object file.  Objdump displays the section because we create it always
when bfd initializes, even if not linking.  readelf is correct here. 
Objdump shouldn't be claiming the section exists.

Perhaps there is a linker hook we can use instead of the elf_object_p
hook?  That would fix objdump.

Alternatively, if it is always the case that a section with
SEC_LINKER_CREATED is not in the object file, then your objdump.c patch
looks OK to me.  This does appear to be the case, as there is no section
header flag for SEC_LINKER_CREATED, so I think this can only happen for
your fake section group.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PATCH: objdump: Skip linker created section
  2005-04-19 18:15 ` James E Wilson
@ 2005-04-19 19:17   ` H. J. Lu
  0 siblings, 0 replies; 4+ messages in thread
From: H. J. Lu @ 2005-04-19 19:17 UTC (permalink / raw)
  To: James E Wilson; +Cc: binutils

On Tue, Apr 19, 2005 at 11:15:29AM -0700, James E Wilson wrote:
> On Sun, 2005-04-17 at 07:37, H. J. Lu wrote:
> > Should objdump skip
> > linker created section? Readelf doesn't display it.
> 
> readelf does not display the section because it doesn't exist in the
> object file.  Objdump displays the section because we create it always
> when bfd initializes, even if not linking.  readelf is correct here. 
> Objdump shouldn't be claiming the section exists.
> 
> Perhaps there is a linker hook we can use instead of the elf_object_p
> hook?  That would fix objdump.
> 
> Alternatively, if it is always the case that a section with
> SEC_LINKER_CREATED is not in the object file, then your objdump.c patch
> looks OK to me.  This does appear to be the case, as there is no section
> header flag for SEC_LINKER_CREATED, so I think this can only happen for
> your fake section group.

I believe that a SEC_LINKER_CREATED section never exists in the input
file. Otherwise, it is a bug.


H.J.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PATCH: objdump: Skip linker created section
  2005-04-17 14:37 PATCH: objdump: Skip linker created section H. J. Lu
  2005-04-19 18:15 ` James E Wilson
@ 2005-04-20  9:26 ` Nick Clifton
  1 sibling, 0 replies; 4+ messages in thread
From: Nick Clifton @ 2005-04-20  9:26 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

Hi H. J.

> 2005-04-17  H.J. Lu  <hongjiu.lu@intel.com>
> 
> 	* objdump.c (dump_section_header): Skip linker created section.

Approved - please apply.

Cheers
   Nick


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-04-20  9:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-17 14:37 PATCH: objdump: Skip linker created section H. J. Lu
2005-04-19 18:15 ` James E Wilson
2005-04-19 19:17   ` H. J. Lu
2005-04-20  9:26 ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).