Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!bywater!scifi!watson!arnor!prener!prener From: prener@watson.ibm.com (Dan Prener) Newsgroups: comp.unix.aix Subject: Re: Assembly language problem on RS/6000 Keywords: Assembly, TOC Message-ID: <1991May1.001807.9382@watson.ibm.com> Date: 1 May 91 00:18:07 GMT References: <28338@neptune.inf.ethz.ch> Sender: news@watson.ibm.com (NNTP News Poster) Reply-To: prener@prener.watson.ibm.com (Dan Prener) Organization: IBM T.J. Watson Research Center Lines: 38 Nntp-Posting-Host: prener In article <28338@neptune.inf.ethz.ch>, brandis@inf.ethz.ch (Marc Brandis) writes: |> I am trying to write an assembly language routine that I can assign to a |> function pointer in C. There is no problem when calling the routine directly, |> but assigning it to a pointer to a function causes a linker error with the |> message, that the symbol 'my_routine' could not be resolved. Here is what I |> wrote: |> |> .toc |> .globl my_routine[ds] |> .csect my_routine[ds] |> .long .my_routine[PR] |> .long TOC[tc0] |> .long 0 |> .globl .my_routine[PR] |> .csect .my_routine[PR] |> |> # here comes the routine itself |> stm ... |> |> |> It looks like '.my_routine' becomes exported correctly, but not 'my_routine', |> although it is declared as global. The IBM manuals were not a big help in |> figuring out what is going wrong. I could imagine that something is wrong with |> the section identifier [ds], but as the manuals imply, a procedure descriptor |> belongs into a descriptor segment. |> |> Any hints what is wrong or missing here? Thanks for any reply! |> |> |> Marc-Michael Brandis |> Computer Systems Laboratory, ETH-Zentrum (Swiss Federal Institute of Technology) |> CH-8092 Zurich, Switzerland |> email: brandis@inf.ethz.ch Your assembly code as such is fine. How are you linking it, and how are you calling it? -- Dan Prener (prener @ watson.ibm.com)