Patching gas to remove relaxation.
Sander Bogaert
sander.bogaert@elis.ugent.be
Mon Nov 25 15:55:00 GMT 2013
More information about the Binutils mailing list
Mon Nov 25 15:55:00 GMT 2013
- Previous message (by thread): [gold commit] PR gold/16203: Fix build failure on Gentoo/FreeBSD
- Next message (by thread): [PATCH 1/2] bfd/elfnn-aarch64.c: Fix miscalculation of GOTPLT offset for ifunc syms.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
-----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-----
- Previous message (by thread): [gold commit] PR gold/16203: Fix build failure on Gentoo/FreeBSD
- Next message (by thread): [PATCH 1/2] bfd/elfnn-aarch64.c: Fix miscalculation of GOTPLT offset for ifunc syms.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list