C

거믄마루 2013. 1. 16. 10:01
일전에 높은 버전 GLIBC 로 링크하여 빌드된 프로그램이 그보다 낮은 버전 GLIBC 시스템에서 호환성 문제로 실행되지 않는 문제가 발생한 적이 있는데, 
문제를 해결하는 것은 그렇게 어렵지 않았지만, 이러한 문제를 어떻게 미리 예측/파악하고, 또 미리 회피할 수 있는지 이리 저리 궁리하게 되었다.
이런 일을 예측하기 위해서는 프로그램이나 라이브러리의 심볼테이블을 확인하는 nm 명령이 유용하다는 것을 발견했다.
$ nm GLIBC_호환성_문제있는_프로그램명 | grep @GLIBC_
                 U __ctype_b_loc@@GLIBC_2.3
                 U __dn_expand@@GLIBC_2.2.5
                 U __errno_location@@GLIBC_2.2.5
                 U __libc_start_main@@GLIBC_2.2.5
                 U __res_search@@GLIBC_2.2.5
                 U access@@GLIBC_2.2.5
                 U backtrace@@GLIBC_2.2.5
                 U backtrace_symbols@@GLIBC_2.2.5
                 U close@@GLIBC_2.2.5
                 U connect@@GLIBC_2.2.5
                 U fcntl@@GLIBC_2.2.5
                 U fflush@@GLIBC_2.2.5
                 U fprintf@@GLIBC_2.2.5
                 U free@@GLIBC_2.2.5
                 U freopen@@GLIBC_2.2.5
                 U gethostbyname_r@@GLIBC_2.2.5
                 U getopt@@GLIBC_2.2.5
                 U getpid@@GLIBC_2.2.5
                 U gettimeofday@@GLIBC_2.2.5
                 U htons@@GLIBC_2.2.5
                 U ioctl@@GLIBC_2.2.5
                 U localtime_r@@GLIBC_2.2.5
                 U malloc@@GLIBC_2.2.5
                 U memcpy@@GLIBC_2.2.5
                 U memmove@@GLIBC_2.2.5
                 U memset@@GLIBC_2.2.5
                 U ns_initparse@@GLIBC_2.9
                 U ns_parserr@@GLIBC_2.9
                 U ns_sprintrr@@GLIBC_2.9
0000000000606a00 B optarg@@GLIBC_2.2.5
                 U poll@@GLIBC_2.2.5
                 U printf@@GLIBC_2.2.5
                 U pthread_create@@GLIBC_2.2.5
                 U pthread_mutex_lock@@GLIBC_2.2.5
                 U pthread_mutex_unlock@@GLIBC_2.2.5
                 U pthread_self@@GLIBC_2.2.5
                 U recv@@GLIBC_2.2.5
                 U send@@GLIBC_2.2.5
                 U snprintf@@GLIBC_2.2.5
                 U socket@@GLIBC_2.2.5
0000000000606a10 B stdout@@GLIBC_2.2.5
                 U strchr@@GLIBC_2.2.5
                 U strcpy@@GLIBC_2.2.5
                 U strdup@@GLIBC_2.2.5
                 U strerror@@GLIBC_2.2.5
                 U strftime@@GLIBC_2.2.5
                 U strlen@@GLIBC_2.2.5
                 U strrchr@@GLIBC_2.2.5
                 U time@@GLIBC_2.2.5
                 U vfprintf@@GLIBC_2.2.5

위에서 보는 바와 같이 GLIBC 2.9 버전이상의 라이브러리가 필요한 함수는 ns_initparse, ns_parserr, ns_sprintrr 이렇게 3개의 함수이다. 

나머지는 모두 2.2 대 버전을 사용한다는 것을 알 수 있다.

각 함수가 어떤 라이브러리에 속해있는지 알려면 다시 여러 라이브러리 디렉토리에서 find 명령을 사용하여 해당 라이브러리에 대한 nm 명령의 결과로 "T 함수명" 을 가지고 있는지 보면 된다. 그렇게 알아낸 라이브러리명을 사용하여 스태틱라이브러리가 있으면 스태틱으로 링크하면 되는 것이다. 이러한 과정을 쉘  프로그램으로 모두 자동화하는 것도 조금 귀찮기는 하겠지만 불가능해보이지는 않는다. 만약 그런 프로그램을 작성하면 해당 프로그램이나 방법을 다시 포스팅하겠다...


오늘은 여기까지...


----------------------------------------------------->8

여러분의 작은 관심과 댓글이 글을 쓰는데 많은 도움이 됩니다.

HAPPY DAY

...


이전 댓글 더보기
I came here to study http://apetube.in.net/ ape tubes Reading between the lines of our conversation, it feels as though Doig has arrived at a kind of crossroads. He’s just been working in New York, and he still maintains his London studio. Does he, I wonder, feel he’s exhausted Trinidad as a subject?
Where are you calling from? http://xvideos-xvideos.in.net/ www xvideos in The 20-year-old former Disney star has been generating plenty of headlines recently. At the MTV Video Music Awards last month, she got people talking about her risque duet with Robin Thicke. Monday, she made more headlines with the debut of her “Wrecking Ball video,” in which she shows a more emotional side — and more. In one memorable scene, Cyrus can be seen completely nude atop a wrecking ball.
I'm on work experience http://madthumbs.fun/ mad thumb
The feminist campaigner Caroline Criado-Perez, who received rape and death threats on Twitter earlier this year, said: "On the face of it a commissioner would be great. It was clear from [my] experience that it required a lot of pressure on the police to take action [on rape threats]. It was awful that the pressure had to come from me and the media; if there was someone at government level it might mean more... Victims don't have to be the ones making the police take action."
We work together http://wifelovers.in.net/ www.wifelovers.com Not to be outdone - pop princess Christina Aguilera appeared on four covers: the March 2007 cover of Maxim, the November 2002 cover of Rolling Stone, the July 2007 cover of Ralph and January 2008 cover of Marie Claire.
I like watching football http://xnxxpornhub.in.net/ xxnx.com Investigators don't know if organs given to three other patients — the North Carolina donor's heart, liver and second kidney_were infected with the rabies virus, but all three were considered at risk. Their recipients received anti-rabies treatment "and to date remain well," said CDC researcher Dr. Neil Vora, the lead author.
About a year http://pornmd.in.net/ mdporn The two met while William attended a county fair in Wales, where he serves as a helicopter pilot for the Royal Air Force. After the meeting, West told a local television station that the prince and his squadron "saved my life.
I can't hear you very well http://xhamsterporn.in.net/ xxxhamster @Logic ... you are, of course, right. It is just that when conservatives throw out the term "normal family", they're usually thinking of a father who works, a mother who doesn't and two children who won't even hear the word "sex" (let alone have any sexual thoughts) until marriage.
Can I take your number? http://madthumbs.fun/ mad thumbs "It is regrettable that the Venezuelan government has again decided to expel U.S. diplomatic officials based on groundless allegations, which require reciprocal action. It is counterproductive to the interests of both our countries," the State Department said.
I was born in Australia but grew up in England http://maturetube.in.net/ mature tubes "If the Security Council fails to act, a coalition will form. It should be as broad as possible. It will be based on the Arab League, which has condemned the crime and alerted the international community. It will have the support of Europeans.
We've got a joint account http://xhamsters.in.net/ xhams However, the agreement was placed under scrutiny by local residents – many of whom had moved in to the village after the agreements were made – who made representations to the Borough Council to apply the rigid interpretation of the 1985 Notice.
Will I get paid for overtime? http://voyeurweb.in.net/ www.voyeurweb.com So, yes, serious questions remain: is this a good diplomatic move for the United States? Can the Syrians and Russians be trusted? And where does the war-torn country, and the rest of the region, go from here?
Looking for a job http://freeones.in.net/ freeone The VNA deal would give Ardagh and industry leaderOwens-Illinois over 75% of the US market for beer and liquorbottles between them. However, it is seen as a vital step inArdagh's plans to deleverage via an initial public offering.
Can you hear me OK? http://pornmd.in.net/ pornmd.com hope this punk gets the maximum sentence. It was NOT his job to spark a public debate about U.S. foreign and military policy by releasing the data to WikiLeaks, while serving in Iraq. He’s a traitor and should be hung
We used to work together http://maturetube.in.net/ mature tubes Under the NFL's PED policy, a first-time offense nets a suspension. Under its more general substance-abuse policy, players are placed into Stage 2 of the policy after initial positive tests. Once in Stage 2, a player is subject to a four-game suspension for subsequent positive tests.
I'm a member of a gym http://apetube.in.net/ apetune Logan, born Oct. 22, 2010, was diagnosed shortly after his first birthday with acute myeloid leukemia, according to the Associated Press. He also had Fanconi anemia, a rare disease that can lead to cancer.
Have you got a current driving licence? http://xnxxxxnn.in.net/ xvideo
Quinn didn’t do or say anything over the past week to change the narrative or make up this kind of ground on Weiner, but then she has done little in this campaign to act like a future mayor or sound like one. She was supposed to be the feisty city kid in the race, she was supposed to be the downtown political club fighter. Then she let Weiner be the one to take the fight to her.
How would you like the money? http://livejasmin.in.net/ livejasmin sex Unlike wealth management products, they will also be forcedto regularly publish a net asset value to reinforce the ideathat returns are based on the performance of the asset, not thecreditworthiness of the bank.
Enter your PIN http://eporner.in.net/ eporn The bodies of the boys were discovered in the boot of the crashed car about four miles from Westport, Co Mayo, on Monday afternoon. Mr Chada, known locally as Sanj, remains in hospital being treated for injuries suffered in the crash.
Thanks for calling http://xnxxpornhub.in.net/ desi xnxx It's so annoying at this time of year when we know our summer sun and the chance of a beach holiday are far behind us but we're still subjected to the sight of various celebrities frolicking in exotic climes.
I'll send you a text http://xnxxlove.in.net/ porno xnxx The proposal is now in the hands of a group of Western nations — the United States, Britain, France, China and Russia and Germany were meeting Tuesday— who have imposed economic sanctions on Iran to get it to let inspectors verify its claim that the program is entirely peaceful.