This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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: [PATCH] Fix IA-64


  Jakub> +# define PSEUDO(name, syscall_name, args)

The unwind info for functions generated by this macro will be all wrong.

  > +.Lpseudo_cancel:
  > +     .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS,ASM_UNW_PRLG_GRSAVE(args);
  > +     alloc loc0 = ar.pfs, args, 5, args, 0;
  > +     mov loc1 = rp;;

If you want to use the implicit, .prologue-encoded saves, you must pay
attention to the save order: rp needs to go into the first save
register, pfs in the second.  That is, the register numbers in the
above needs to be switched:

  > +     alloc loc1 = ar.pfs, args, 5, args, 0;
  > +     mov loc0 = rp;;

also, the above code ought to be followed by a ".body" directive.

You may want to use .save directives instead; those are easier to get right
in hand-coded assembly.

This would have to be adjust accordingly:

  Jakub> +     mov rp = loc1;
  Jakub> +     mov ar.pfs = loc0;

Now this one is tricky:

  Jakub> +.section .gnu.linkonce.t.__syscall_error_##args, "ax";

This leads to non-contiguous code.  The previous code should be
terminated with a ".endp" directive, and then the entry-state needs to
be re-established.  This can be done with a proglogue covering an
empty region:

  Jakub> +.global __syscall_error_##args;
  Jakub> +.hidden __syscall_error_##args;
  Jakub> +__syscall_error_##args:
	       .prologue
	       .save ar.pfs, loc1
	       .save rp, loc0
	       .body
  Jakub> +     mov loc4 = r1;;

Then some more loc0/loc1 adjustment:

  Jakub> +     mov rp = loc0;
  Jakub> +     mov r8 = -1;
  Jakub> +     mov ar.pfs = loc1;
  Jakub> +     ret;

Again, this is switching code sections in the middle of a procedure:

  Jakub> +.previous;

I'd not recommend that.  Gas tends to get such switches wrong for the
unwind info.

I'd highly recommend to double-check the sanity of the unwind info
with "readelf -u".  This can save lots of time.

Thanks,

	--david


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