Skip to content

Instantly share code, notes, and snippets.

@dakkar
Created January 30, 2019 17:27
Show Gist options
  • Save dakkar/d0bfaa33f1c5d6efa661373f5160f18a to your computer and use it in GitHub Desktop.
Save dakkar/d0bfaa33f1c5d6efa661373f5160f18a to your computer and use it in GitHub Desktop.
the limits of GCC's unicode identifier support
CFLAGS=-std=c99
use-it: use-it.o symbol.o
symbol.o: symbol.c symbol.h
use-it.o: use-it.c symbol.h
#include "symbol.h"
void *re\u00E4lloc(void *ptr, size_t size) {
return realloc(ptr,size);
}
#pragma once
#include <stdlib.h>
extern void *re\u00E4lloc(void *ptr, size_t size);
$ nm use-it
0000000000201040 B __bss_start
w __cxa_finalize@@GLIBC_2.2.5
0000000000201030 D __data_start
0000000000201030 W data_start
0000000000201038 D __dso_handle
0000000000200df8 d _DYNAMIC
0000000000201040 D _edata
0000000000201048 B _end
00000000000007b4 T _fini
0000000000201000 d _GLOBAL_OFFSET_TABLE_
w __gmon_start__
00000000000007ec r __GNU_EH_FRAME_HDR
0000000000000540 T _init
0000000000200df0 t __init_array_end
0000000000200de8 t __init_array_start
00000000000007c0 R _IO_stdin_used
w _ITM_deregisterTMCloneTable
w _ITM_registerTMCloneTable
00000000000007b0 T __libc_csu_fini
0000000000000750 T __libc_csu_init
U __libc_start_main@@GLIBC_2.2.5
00000000000006ba T main
U malloc@@GLIBC_2.2.5
U printf@@GLIBC_2.2.5
0000000000000723 T reälloc
U realloc@@GLIBC_2.2.5
00000000000005b0 T _start
0000000000201040 D __TMC_END__
#include <stdlib.h>
#include <stdio.h>
#include "symbol.h"
int main(int argc, char **argv) {
void *x = malloc(10);
printf("first pointer: %p",x);
x=re\u00E4lloc(x,20);
printf("second pointer: %p",x);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment