public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Dynamic object or not...
@ 2010-11-02  9:57 Paulo J. Matos
  2010-11-02 12:01 ` Alan Modra
  0 siblings, 1 reply; 3+ messages in thread
From: Paulo J. Matos @ 2010-11-02  9:57 UTC (permalink / raw)
  To: binutils

Hi,

This is a very simple question but I can't find a final answer anywhere
else so here it goes.

If an object is dynamic, then it has a dynamic symbol table and possibly
a dynamic relocation table, otherwise it has a symbol table and a
relocation table. It is not possible for an object to have both a symbol
table and a dynamic symbol table or both relocation tables, etc. Is this
right?

Cheers,

-- 
PMatos

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

* Re: Dynamic object or not...
  2010-11-02  9:57 Dynamic object or not Paulo J. Matos
@ 2010-11-02 12:01 ` Alan Modra
  2010-11-02 12:20   ` Paulo J. Matos
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Modra @ 2010-11-02 12:01 UTC (permalink / raw)
  To: Paulo J. Matos; +Cc: binutils

On Tue, Nov 02, 2010 at 09:57:38AM +0000, Paulo J. Matos wrote:
> If an object is dynamic, then it has a dynamic symbol table and possibly
> a dynamic relocation table, otherwise it has a symbol table and a
> relocation table. It is not possible for an object to have both a symbol
> table and a dynamic symbol table or both relocation tables, etc. Is this
> right?

No.  Many dynamic objects have both a normal and a dynamic symbol
table.  There is no reason why they cannot have both types of
relocation too.  eg.

$ cat hello.c
#include <stdio.h>
int main (void) { printf ("Hello!\n"); return 0; }
$ gcc -o hello -O2 -Wl,-emit-relocs hello.c
$ readelf -a --wide hello | less

-- 
Alan Modra
Australia Development Lab, IBM

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

* Re: Dynamic object or not...
  2010-11-02 12:01 ` Alan Modra
@ 2010-11-02 12:20   ` Paulo J. Matos
  0 siblings, 0 replies; 3+ messages in thread
From: Paulo J. Matos @ 2010-11-02 12:20 UTC (permalink / raw)
  To: binutils

Alan Modra <amodra@gmail.com> writes:

>
> No.  Many dynamic objects have both a normal and a dynamic symbol
> table.  There is no reason why they cannot have both types of
> relocation too.  eg.
>

Of course, it makes sense. Thanks for the example!

> $ cat hello.c
> #include <stdio.h>
> int main (void) { printf ("Hello!\n"); return 0; }
> $ gcc -o hello -O2 -Wl,-emit-relocs hello.c
> $ readelf -a --wide hello | less

-- 
PMatos

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

end of thread, other threads:[~2010-11-02 12:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-02  9:57 Dynamic object or not Paulo J. Matos
2010-11-02 12:01 ` Alan Modra
2010-11-02 12:20   ` Paulo J. Matos

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).