This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
a question about gas
- From: Lope De Vega <lope dot vega at yahoo dot com>
- To: binutils at sources dot redhat dot com
- Date: Wed, 10 Oct 2007 10:54:49 -0700 (PDT)
- Subject: a question about gas
Hello,
I find there are a few inconsistencies within the
documentation and what actually gas does. Which I can
remeber right now is for example the use of
STT_FUNCTION, like this:
..globl my_func
..type my_func STT_FUNCTION
leads to:
main.S:23: Error: unrecognized symbol type
"STT_FUNCTION"
So better to keep using `,@function' instead.
Documentation says:
The first variant will be accepted by the GNU
assembler on all architectures so that variant should
be used for maximum portability
It seems to me that I've found other but I couldn't
mention them right now, it's just that I've been over
a week with gas and I'm still a bit "overhelmed".
What I wanted to ask is how should I do to define a
global symbol, thus, I'm using several files, so I did
setup a common.S (I go via gcc), and made a small
macro, such a file looks like this:
..text
..macro global_def sym, val
.globl \sym
.equ \sym, \val
..endm
.global_def _sys_brk, 45
But then when I'm debugging I can't never see that
value but rather it's address, independently how I
reference it, for example:
xorl %eax, %eax
movl $_sys_brk, %eax -> 0xb7f0402d
movl _sys_brk, %eax -> 0x1d002800
This only happens when within the shared library I'm
creating so it segfaults. As I go via libtool I also
get a static library, in which everything seems to
word like a charm though.
Any hints?
Regards,
____________________________________________________________________________________
Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list&sid=396545469