This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

Patching gas to remove relaxation.


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I'm trying to patch the GNU Assembler to prevent it from doing
relaxation. So I'm trying to retain symbols in relocations which are
exchanged with the section symbol by default.

I had a very simple, working patch for binutils 2.18. It basically
forces the "tc_fix_adjustable" function to return false by patching
the different back-end implementations. Some small other changes were
necessary too. (http://goo.gl/o57l9D)

For the newer binutils (2.22) this no longer works. The reason is the
check added in commit 76d12939 (http://goo.gl/KBFJdy).

To fix this I tried two things:

1. setting the BSF_KEEP flag for the symbols that were previously
'relaxed away' in the different fix_adjustment functions of the
architecture back-ends.

I simply do this by adding (for example):

	'symbol_get_bfdsym (fixP->fx_addsy)->flags |= BSF_KEEP;'

to gas/config/tc-arm.c:arm_fix_adjustable (fixS * fixP) right before
it's forced to return false.

2. comment out the previously mentioned check

Both manage to pass the if check ( kind of obvious for the second :-)
) but result in a new problem; "symbol `L0' required but not
present". This is caused by http://goo.gl/TMpzIQ . It seems like the
symbol gets removed in some way after all but not entirely since it's
still iterated?

So I have the following questions:
* Is my approach to achieve the removal of relaxation sane?

* Any suggestions on what I'm missing, do I need to patch other parts
to prevent deletion of the symbol?

* Could the "!=" on this line: http://goo.gl/Y4bwzr possibly be a bug?
Seems like it might want to check the single bit instead of the whole
integer?

Kind regards,
Sander

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iQEcBAEBAgAGBQJSk3BnAAoJENKqM4oiKBAvTxcIAJCuCNbNqyUJApvo2V+1KnNV
S9pnt08e1c2/nWGEx/5QK27ewqYvt7Xu7RBkMTDbAj+gZLZ/vP32+N5PnngkkxoJ
vN4/BD8N92vrpEJDnXYEsiMX2C3O/6b9n0uRG/aQYnzh5PCoqVAdWzAP4okW41l8
eiGDk2Vah6w19dG1IpWWs4Gdp5loXc85JY4PpMXyJIOA+LXXI/CEB9bUv3lIE3Qp
AjHszNJmL1NxIeowZDFAmM0aNY5TeWfVwBifJQEKrBdnfjvhB00fk48Qjj/QOA0j
RwBU8Yv2EIALvLUBR/K7tZAkh3yK/wKcD/jVdFR+D6DFQZF4vx8Dp+j5Y52Dao4=
=RMfp
-----END PGP SIGNATURE-----


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