This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ARM stub sizing fix
On Thu, Jan 14, 2010 at 10:25:28PM +1030, Alan Modra wrote:
> required on another branch to the same destination. However, the code
> in arm_type_of_stub clearly returns stub types that depend on branch
> offset and reloc type. You could easily have both a
> short_branch_v4t_thumb_arm and a long_branch_v4t_thumb_arm to the same
> destination, with sorry results if the short version happened to be
> created first. Also, addition of stubs for one iteration of stub
I think this is a bug in arm_type_of_stub. short_branch_v4t_thumb_arm
and long_branch_v4t_thumb_arm are the same type of stub, based on how
far the destination is from the stub. So I think the branch_offset
check is the wrong thing.
We're picking the stub type before we know where the stub ends up. I
think we have to give the two the same type, but distinguish in
find_stub_size_and_template.
> I also add an assert that will trigger if there is a dependence on
> reloc type. I don't know enough about ARM code to know whether it's
> possible to have, say, one branch to a function using R_ARM_THM_CALL
> and another using R_ARM_THM_JUMP24 (possible tail call?).
You're right, that's just a normal and tail call to the same function.
--
Daniel Jacobowitz
CodeSourcery