https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #46 from Douglas Mencken <dougmencken at gmail dot com> ---
(In reply to Wilco from comment #38)

> You can have data in text sections, including bytes and half words. Even if
> instructions aligned automatically, the function label might be unaligned if
> it was preceded by a byte.

I found example of such code

** ---------- Find_GetSectionInfo_Symbol ---------- **
** input: (none)
** output: (see Query_CFM_FindSymbol)
** ------------------------------------------------ **
Find_GetSectionInfo_Symbol:
                mflr                    r4
                bl                      _Get_Data_Address
                mflr                    r3
                mtlr                    r4
                la                      r3,@str_getSectionInfo-@data(r3)
                b                       Query_CFM_FindSymbol

** -------------- _Get_Data_Address --------------- **
** output: LR = address of data (below)
** ------------------------------------------------ **
_Get_Data_Address:
                blrl

** ++++++++++++++++++++++++++++++++++++++++++++++++ **

@data:
@str_callUP:
                DC.B                    17,"CallUniversalProc"
@str_callOSTrapUP:
                DC.B                    23,"CallOSTrapUniversalProc"
@str_getSectionInfo:
                DC.B                    18,"FragGetSectionInfo",0

Yeah, PowerPC doesn’t have addressing via PC, thus it requires to do tricks
like that

Reply via email to