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]

Re: ARM/thumb interworking confuses unwinder


Jonathan Larmour wrote:
> In CVS,
> the choice of stub is decided in arm_type_of_stub(), called from
> elf32_arm_size_stubs() which is called in ld's emultempl/armelf.em in
> "gld${EMULATION_NAME}_finish". It does not try and deal with a simple stub
> in that code, but then as a result identifies a long call stub instead -
> perhaps it was thinking that other code would fix it up? 

Just to be specific about this, the reloc is R_ARM_THM_CALL and in this
test in elf32_arm_size_stubs():

  if (r_type == R_ARM_THM_CALL)
    {
      if ((!thumb2
            && (branch_offset > THM_MAX_FWD_BRANCH_OFFSET
                || (branch_offset < THM_MAX_BWD_BRANCH_OFFSET)))
          || (thumb2
              && (branch_offset > THM2_MAX_FWD_BRANCH_OFFSET
                  || (branch_offset < THM2_MAX_BWD_BRANCH_OFFSET)))
          || ((st_type != STT_ARM_TFUNC) && !globals->use_blx))
        {

it matches ((st_type != STT_ARM_TFUNC) && !globals->use_blx)) since it's
arm9 and thus armv4t. This test doesn't seem right - although I've tried
simply removing it, and then no stub is generated at all. (since stub_type
== arm_stub_none).

Jifl
-- 
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------       Opinions==mine


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