12
12
#include <unistd.h>
13
13
14
14
#define SCALE_1_TO_1 0x10000L
15
+ #define MIN_OS_VERSION 52
15
16
16
17
#include "profile_gmon.h"
17
18
@@ -196,8 +197,8 @@ void moncleanup(void) {
196
197
}
197
198
198
199
void mongetpcs (uint32 * lowpc , uint32 * highpc ) {
199
- struct Library * ElfBase = NULL ;
200
- struct ElfIFace * IElf = NULL ;
200
+ struct Library * __ElfBase = NULL ;
201
+ struct ElfIFace * __IElf = NULL ;
201
202
struct Process * self ;
202
203
BPTR seglist ;
203
204
Elf32_Handle elfHandle ;
@@ -208,10 +209,10 @@ void mongetpcs(uint32 *lowpc, uint32 *highpc) {
208
209
* lowpc = 0 ;
209
210
* highpc = 0 ;
210
211
211
- ElfBase = OpenLibrary ("elf.library" , 0L );
212
- if (ElfBase ) {
213
- IElf = (struct ElfIFace * ) GetInterface (ElfBase , "main" , 1 , NULL );
214
- if (IElf ) {
212
+ __ElfBase = OpenLibrary ("elf.library" , MIN_OS_VERSION );
213
+ if (__ElfBase ) {
214
+ __IElf = (struct ElfIFace * ) GetInterface (__ElfBase , "main" , 1 , NULL );
215
+ if (__IElf ) {
215
216
self = (struct Process * ) FindTask (0 );
216
217
seglist = GetProcSegList (self , GPSLF_CLI | GPSLF_SEG );
217
218
@@ -236,13 +237,13 @@ void mongetpcs(uint32 *lowpc, uint32 *highpc) {
236
237
}
237
238
}
238
239
239
- if (IElf ) {
240
- DropInterface ((struct Interface * ) IElf );
241
- IElf = NULL ;
240
+ if (__IElf ) {
241
+ DropInterface ((struct Interface * ) __IElf );
242
+ __IElf = NULL ;
242
243
}
243
- if (ElfBase ) {
244
- CloseLibrary (ElfBase );
245
- ElfBase = NULL ;
244
+ if (__ElfBase ) {
245
+ CloseLibrary (__ElfBase );
246
+ __ElfBase = NULL ;
246
247
}
247
248
}
248
249
0 commit comments