[DTrace-devel] [PATCH] libproc: remove const from declarations

Eugene Loh eugene.loh at oracle.com
Tue Sep 8 09:08:44 PDT 2020


One other thing, I guess.  If it's easy enough to add a characterization 
of what constitutes "some newer systems" that would be nice.  E.g., how 
could a tester confirm the problem and fix?


On 09/08/2020 09:05 AM, Eugene Loh wrote:
> Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
> subject to one small nit...
>
> On 09/02/2020 01:57 PM, Kris Van Hees wrote:
>> The r_debug_offsets and link_map_offsets arrays were declared 'const'.
>> This is causing issues on some newer systems where these arrays are
>> stored in memory that is marked RO.  Performing memcpy) and memmove()
> Missing '('.
>
>> on these areas triggers on error.
>>
>> Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
>> ---
>>    libproc/mkoffsets.sh | 8 ++++----
>>    1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/libproc/mkoffsets.sh b/libproc/mkoffsets.sh
>> index d87265b0..91f85d4e 100755
>> --- a/libproc/mkoffsets.sh
>> +++ b/libproc/mkoffsets.sh
>> @@ -131,8 +131,8 @@ typedef struct rtld_offsets {
>>    	size_t size[2];
>>    } rtld_offsets_t;
>>    
>> -extern const rtld_offsets_t r_debug_offsets[R_LAST_OFFSET+1];
>> -extern const rtld_offsets_t link_map_offsets[L_LAST_OFFSET+1];
>> +extern rtld_offsets_t r_debug_offsets[R_LAST_OFFSET+1];
>> +extern rtld_offsets_t link_map_offsets[L_LAST_OFFSET+1];
>>    
>>    #endif
>>    EOF
>> @@ -183,8 +183,8 @@ cat > $INIT <<'EOF'
>>    #include <string.h>
>>    #include "rtld_offsets.h"
>>    
>> -const rtld_offsets_t r_debug_offsets[R_LAST_OFFSET+1];
>> -const rtld_offsets_t link_map_offsets[L_LAST_OFFSET+1];
>> +rtld_offsets_t r_debug_offsets[R_LAST_OFFSET+1];
>> +rtld_offsets_t link_map_offsets[L_LAST_OFFSET+1];
>>    static int initialized;
>>    
>>    _dt_constructor_(rtld_offsets_init)
>
> _______________________________________________
> DTrace-devel mailing list
> DTrace-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/dtrace-devel




More information about the DTrace-devel mailing list